diff options
author | Matthieu Aubry <mattab@users.noreply.github.com> | 2016-11-15 18:14:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-15 18:14:15 +0300 |
commit | cd6af07f42a9558c2243b44dc3c45c4963b9a944 (patch) | |
tree | 802a311abcdab482ec4ab8bc9ba7a81b28b981c7 | |
parent | 2258605179eaf3e86cf5d0bf2c1f367011abeac6 (diff) |
Link to plugins (#10862)
* new SecurityInfo plugin release
* Linking to plugins
* Port
* fix system test
* Footer event message
* Content tracking ad
* No infobox in widget in dashboard to keep it lean
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | core/ProfessionalServices/Advertising.php | 10 | ||||
-rw-r--r-- | plugins/Events/Reports/Base.php | 19 | ||||
-rw-r--r-- | plugins/Feedback/templates/index.twig | 14 | ||||
-rw-r--r-- | plugins/Goals/templates/conversionOverview.twig | 2 | ||||
-rw-r--r-- | plugins/ProfessionalServices/ProfessionalServices.php | 40 | ||||
-rw-r--r-- | plugins/ProfessionalServices/Promo.php | 108 | ||||
-rw-r--r-- | plugins/ProfessionalServices/Widgets/PromoServices.php | 2 | ||||
-rw-r--r-- | plugins/ProfessionalServices/lang/en.json | 2 | ||||
-rw-r--r-- | plugins/Widgetize/tests/System/WidgetTest.php | 2 | ||||
-rw-r--r-- | tests/PHPUnit/Integration/ProfessionalSupport/AdvertisingTest.php | 7 | ||||
-rw-r--r-- | tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getWidgetMetadata.xml | 2 |
12 files changed, 153 insertions, 57 deletions
diff --git a/.gitignore b/.gitignore index 8a53c53e11..e5748d7c31 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ php_errors.log *.tmp *.pyc .DS_Store - +/.idea/ /bootstrap.php /build /composer.phar diff --git a/core/ProfessionalServices/Advertising.php b/core/ProfessionalServices/Advertising.php index 07e42c46e4..ef423200ae 100644 --- a/core/ProfessionalServices/Advertising.php +++ b/core/ProfessionalServices/Advertising.php @@ -67,16 +67,6 @@ class Advertising } /** - * Get URL for letting people know about upgrade to On premises - * - * @return string - */ - public function getPromoUrlForPiwikProUpgrade() - { - return 'https://piwik.org/recommends/piwik-pro-from-app'; - } - - /** * Appends campaign parameters to the given URL for promoting any Professional Support for Piwik service. * * @param string $url diff --git a/plugins/Events/Reports/Base.php b/plugins/Events/Reports/Base.php index a43ba0dbfa..005e1dda5a 100644 --- a/plugins/Events/Reports/Base.php +++ b/plugins/Events/Reports/Base.php @@ -8,6 +8,8 @@ */ namespace Piwik\Plugins\Events\Reports; +use Piwik\EventDispatcher; +use Piwik\Plugin\ViewDataTable; use Piwik\Plugins\Events\API; use Piwik\Plugins\Events\Columns\Metrics\AverageEventValue; use Piwik\Report\ReportWidgetFactory; @@ -36,5 +38,22 @@ abstract class Base extends \Piwik\Plugin\Report } } + public function configureView(ViewDataTable $view) + { + $this->configureFooterMessage($view); + } + + protected function configureFooterMessage(ViewDataTable $view) + { + if ($this->isSubtableReport) { + // no footer message for subtables + return; + } + + $out = ''; + EventDispatcher::getInstance()->postEvent('Template.afterEventsReport', array(&$out)); + $view->config->show_footer_message = $out; + } + } diff --git a/plugins/Feedback/templates/index.twig b/plugins/Feedback/templates/index.twig index f3c36bc06e..274b136cd9 100644 --- a/plugins/Feedback/templates/index.twig +++ b/plugins/Feedback/templates/index.twig @@ -42,7 +42,7 @@ <p> • {{ 'Feedback_ProfessionalServicesOptimizationMaintenance'|translate }}</p> <p> • {{ 'Feedback_ProfessionalServicesPhoneEmailSupport'|translate }}</p> <p> • {{ 'Feedback_ProfessionalServicesTraining'|translate }}</p> - <p> • {{ 'Feedback_ProfessionalServicesPremiumFeatures'|translate }}</p> + <p> • <a rel='noreferrer' target='_blank' href='https://piwik.org/recommends/premium-plugins'>{{ 'Feedback_ProfessionalServicesPremiumFeatures'|translate }}</a></p> <p> • {{ 'Feedback_ProfessionalServicesCustomDevelopment'|translate }}</p> <p> • {{ 'Feedback_ProfessionalServicesAnalystConsulting'|translate }}</p> @@ -55,6 +55,18 @@ </form> </div> + <div piwik-content-block content-title="Premium products"> + <p>Grow your business, understand your audience better and increase your sales and conversions with a premium plugin for Piwik: + <p> • <a rel='noreferrer' target='_blank' href='https://piwik.org/recommends/ab-testing-learn-more/'>A/B Testing Platform for Piwik Analytics</a>. + </p> + <p> • <a rel='noreferrer' target='_blank' href='https://piwik.org/recommends/media-analytics-website/'>Powerful Video Analytics and Audio Analytics</a>. + </p> + <p> • <a rel='noreferrer' target='_blank' href='https://piwik.org/recommends/activity-log/'>Audit log of user activities happening in your Piwik</a>. + </p> + <p> • <strong><a rel='noreferrer' target='_blank' href='https://piwik.org/recommends/premium-plugins'>All premium plugins.</a></strong> + </p> + </div> + <div piwik-content-block content-title="{{ 'Feedback_DoYouHaveBugReportOrFeatureRequest'|translate|e('html_attr') }}"> <p>{{ 'Feedback_HowToCreateTicket'|translate( "<a target='_blank' href='?module=Proxy&action=redirect&url=http://developer.piwik.org/guides/core-team-workflow%23submitting-a-bug-report'>", diff --git a/plugins/Goals/templates/conversionOverview.twig b/plugins/Goals/templates/conversionOverview.twig index 64f7512600..b3dd870db3 100644 --- a/plugins/Goals/templates/conversionOverview.twig +++ b/plugins/Goals/templates/conversionOverview.twig @@ -18,5 +18,7 @@ <a href="javascript:;" class="segmentedlog" onclick="SegmentedVisitorLog.show('Goals.getMetrics', 'visitConvertedGoalId=={{ idGoal }}', {})"> {{ 'Live_RowActionTooltipWithDimension'|translate('General_Goal'|translate) }} </a> +{{ postEvent("Template.afterGoalConversionOverviewReport") }} <br style="clear:left"/> + </div>
\ No newline at end of file diff --git a/plugins/ProfessionalServices/ProfessionalServices.php b/plugins/ProfessionalServices/ProfessionalServices.php index 203c3bb6f6..442f29edfe 100644 --- a/plugins/ProfessionalServices/ProfessionalServices.php +++ b/plugins/ProfessionalServices/ProfessionalServices.php @@ -8,6 +8,8 @@ namespace Piwik\Plugins\ProfessionalServices; +use Piwik\Common; + class ProfessionalServices extends \Piwik\Plugin { /** @@ -18,6 +20,8 @@ class ProfessionalServices extends \Piwik\Plugin return array( 'AssetManager.getStylesheetFiles' => 'getStylesheetFiles', 'Request.getRenamedModuleAndAction' => 'renameProfessionalServicesModule', + 'Template.afterGoalConversionOverviewReport' => 'getGoalOverviewPromo', + 'Template.afterEventsReport' => 'getEventsPromo', ); } @@ -45,4 +49,40 @@ class ProfessionalServices extends \Piwik\Plugin } } } + + public function isRequestForDashboardWidget() + { + $isWidget = Common::getRequestVar('widget', 0, 'int'); + return $isWidget; + } + + public function getGoalOverviewPromo(&$out) + { + if(\Piwik\Plugin\Manager::getInstance()->isPluginActivated('AbTesting') + || $this->isRequestForDashboardWidget()) { + return; + } + + $out .= ' + <p style="margin-top:3em" class=" alert-info alert">Did you know? + With <a target="_blank" rel="noreferrer" href="https://piwik.org/recommends/ab-testing-learn-more/">A/B Testing for Piwik</a> you can immediately increase conversions and sales by creating different versions of a page to see which grows your business. + </p> + '; + } + + public function getEventsPromo(&$out) + { + if($this->isRequestForDashboardWidget()) { + return; + } + $inlineAd = ''; + if(!\Piwik\Plugin\Manager::getInstance()->isPluginActivated('MediaAnalytics')) { + $inlineAd = '<br/>When you publish videos or audios, <a target="_blank" rel="noreferrer" href="https://piwik.org/recommends/media-analytics-website">Media Analytics gives deep insights into your audience</a> and how they watch your videos or listens to your music.'; + } + $out .= '<p style="margin-top:3em" class=" alert-info alert">Did you know? + <br/>Using Events you can measure any user interaction and gain amazing insights into your audience. <a target="_blank" href="?module=Proxy&action=redirect&url=http://piwik.org/docs/event-tracking/">Learn more</a>. + <br/> To measure blocks of content such as image galleries, listings or ads: use <a target="_blank" href="?module=Proxy&action=redirect&url=http://developer.piwik.org/guides/content-tracking">Content Tracking</a> and see exactly which content is viewed and clicked. + ' . $inlineAd . ' + </p>'; + } } diff --git a/plugins/ProfessionalServices/Promo.php b/plugins/ProfessionalServices/Promo.php index 36f8ae155d..afbe6d0bd0 100644 --- a/plugins/ProfessionalServices/Promo.php +++ b/plugins/ProfessionalServices/Promo.php @@ -8,44 +8,84 @@ namespace Piwik\Plugins\ProfessionalServices; +use Piwik\ProfessionalServices\Advertising; + class Promo { protected $linkTitles = array('Read more', 'Learn more'); - protected $content = array( - array( - 'campaignContent' => 'discoverPower', - 'text' => 'Discover the power of open-source combined with enterprise-grade support and premium functionalities.' - ), - array( - 'campaignContent' => 'bringEnterpriseLevel', - 'text' => 'Bring your analytics to enterprise level. Upgrade your Piwik platform and receive access to numerous premium features and assistance from experts.' - ), - array( - 'campaignContent' => 'funnelAnalytics', - 'text' => 'Want Funnel Analytics? Get Premium features and enterprise-grade support.' - ), - array( - 'campaignContent' => 'monitoringAndIncident', - 'text' => 'Do you need 24/7 Monitoring and Incident Handling for your Piwik? Get Premium features and enterprise-grade support.' - ), - array( - 'campaignContent' => 'slowingDown', - 'text' => 'Is your Piwik slowing down? Piwik experts can help with your server setup!' - ), - array( - 'campaignContent' => 'excitingFeatures', - 'text' => 'Want to know how to use all the exciting features in Piwik? Try a User training to be up to speed with working with Piwik.' - ), - array( - 'campaignContent' => 'slowingDown', - 'text' => 'Did you know you can adjust the look and feel of Piwik to your brand, and even replace "Piwik" with your product name? Try the White Label product!', - ), - array( - 'campaignContent' => 'metaSites', - 'text' => 'Did you know you can aggregate the tracked data across hundreds of sites and display it in a single dashboard? Get Premium features and enterprise-grade support.', - ), - ); + protected $content = array(); + + public function __construct() + { + $this->content = array( + // A/B Testing + array( + 'campaignContent' => 'abTesting', + 'url' => 'https://piwik.org/recommends/ab-testing-learn-more', + 'text' => 'Ever wondered what A/B testing is and why it is so important? Check out how you can increase conversions and sales on your website and app.' + ), + array( + 'campaignContent' => 'abTesting', + 'url' => ' https://piwik.org/recommends/ab-testing-website', + 'text' => 'Increase revenue and conversions by comparing different versions of your websites or apps, ad detect the winning variation that will grow your business!' + ), + + // Media Analytics + array( + 'campaignContent' => 'mediaAnalytics', + 'url' => 'https://piwik.org/recommends/media-analytics-website', + 'text' => 'Ever wondered how people interact and engage with videos or audios on your website? Well now you can, and it integrates perfectly into your Piwik.', + ), + + array( + 'campaignContent' => 'mediaAnalytics', + 'url' => 'https://piwik.org/recommends/media-analytics', + 'text' => 'Get powerful insights into how your audience watches your videos and listens to your audio. Media Analytics is now available on the Marketplace.', + ), + + // Piwik training + array( + 'campaignContent' => 'userTraining', + 'url' => 'https://piwik.org/training/?pk_campaign=' . Advertising::CAMPAIGN_NAME_PROFESSIONAL_SERVICES . '&pk_source=Piwik_App', + 'text' => 'Want to know how to use all the exciting features in Piwik? Try a User training to be up to speed with working with Piwik.' + ), + + + // Piwik PRO + // https://piwik.org/recommends/piwik-pro-from-app + array( + 'campaignContent' => 'discoverPower', + 'url' => 'https://piwik.org/recommends/piwik-pro-from-app', + 'text' => 'Discover the power of open-source combined with enterprise-grade support and premium functionalities.' + ), + array( + 'campaignContent' => 'bringEnterpriseLevel', + 'url' => 'https://piwik.org/recommends/piwik-pro-from-app', + 'text' => 'Bring your analytics to enterprise level. Upgrade your Piwik platform and receive access to numerous premium features and assistance from experts.' + ), + array( + 'campaignContent' => 'monitoringAndIncident', + 'url' => 'https://piwik.org/recommends/piwik-pro-from-app', + 'text' => 'Do you need 24/7 Monitoring and Incident Handling for your Piwik? Get Premium features and enterprise-grade support.' + ), + array( + 'campaignContent' => 'slowingDown', + 'url' => 'https://piwik.org/recommends/piwik-pro-from-app', + 'text' => 'Is your Piwik slowing down? Piwik experts can help with your server setup!' + ), + array( + 'campaignContent' => 'whiteLabel', + 'url' => 'https://piwik.org/recommends/piwik-pro-from-app', + 'text' => 'Did you know you can adjust the look and feel of Piwik to your brand, and even replace "Piwik" with your product name? Try the White Label product!', + ), + array( + 'campaignContent' => 'metaSites', + 'url' => 'https://piwik.org/recommends/piwik-pro-from-app', + 'text' => 'Did you know you can aggregate the collected data across hundreds of sites and display it in a single dashboard? Get Premium features and enterprise-grade support.', + ) + ); + } public function getLinkTitle() { diff --git a/plugins/ProfessionalServices/Widgets/PromoServices.php b/plugins/ProfessionalServices/Widgets/PromoServices.php index 516d5860c6..8a34d5500e 100644 --- a/plugins/ProfessionalServices/Widgets/PromoServices.php +++ b/plugins/ProfessionalServices/Widgets/PromoServices.php @@ -47,7 +47,7 @@ class PromoServices extends \Piwik\Widget\Widget $promo = $this->promo->getContent(); - $view->ctaLinkUrl = $this->advertising->getPromoUrlForPiwikProUpgrade(); + $view->ctaLinkUrl = $promo['url']; $view->ctaText = $promo['text']; $view->ctaLinkTitle = $this->promo->getLinkTitle(); diff --git a/plugins/ProfessionalServices/lang/en.json b/plugins/ProfessionalServices/lang/en.json index 1f275d103f..86d44f4d0a 100644 --- a/plugins/ProfessionalServices/lang/en.json +++ b/plugins/ProfessionalServices/lang/en.json @@ -1,5 +1,5 @@ { "ProfessionalServices": { - "WidgetProfessionalServicesForPiwik": "Professional Services for Piwik" + "WidgetProfessionalServicesForPiwik": "Premium Products & Services for Piwik" } }
\ No newline at end of file diff --git a/plugins/Widgetize/tests/System/WidgetTest.php b/plugins/Widgetize/tests/System/WidgetTest.php index 4596913d05..af99759c77 100644 --- a/plugins/Widgetize/tests/System/WidgetTest.php +++ b/plugins/Widgetize/tests/System/WidgetTest.php @@ -1360,7 +1360,7 @@ class WidgetTest extends SystemTestCase ), ), array ( - 'name' => 'Professional Services for Piwik', + 'name' => 'Premium Products & Services for Piwik', 'uniqueId' => 'widgetProfessionalServicespromoServices', 'parameters' => array ( diff --git a/tests/PHPUnit/Integration/ProfessionalSupport/AdvertisingTest.php b/tests/PHPUnit/Integration/ProfessionalSupport/AdvertisingTest.php index d8f728d051..6a83038e14 100644 --- a/tests/PHPUnit/Integration/ProfessionalSupport/AdvertisingTest.php +++ b/tests/PHPUnit/Integration/ProfessionalSupport/AdvertisingTest.php @@ -80,13 +80,6 @@ class AdvertisingTest extends IntegrationTestCase $this->assertTrue($enabled->areAdsForProfessionalServicesEnabled()); } - public function test_getPromoUrlForOnPremises_WithoutContent() - { - $link = $this->advertising->getPromoUrlForPiwikProUpgrade(); - - $this->assertSame('https://piwik.org/recommends/piwik-pro-from-app', $link); - } - public function test_addPromoCampaignParametersToUrl_withoutContentWithoutQuery() { $link = $this->advertising->addPromoCampaignParametersToUrl($this->exampleUrl, 'MyName', 'Installation_Start'); diff --git a/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getWidgetMetadata.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getWidgetMetadata.xml index 250f47704a..17adcdc0ad 100644 --- a/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getWidgetMetadata.xml +++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getWidgetMetadata.xml @@ -2862,7 +2862,7 @@ <isWide>0</isWide> </row> <row> - <name>Professional Services for Piwik</name> + <name>Premium Products & Services for Piwik</name> <category> <id>About Piwik</id> <name>About Piwik</name> |