Replaced usage of deprecated Common::json_encode to json_encode
Replaced usage of deprecated Piwik\Period\Range::factory() to Piwik\Period\Factory::factory()