Skip to content

Commit e913be6

Browse files
committed
adds utms and cross compatibility mechanism
1 parent 4d24c2d commit e913be6

File tree

14 files changed

+44
-29
lines changed

14 files changed

+44
-29
lines changed

classes/Visualizer/Gutenberg/Block.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function enqueue_gutenberg_scripts() {
105105

106106
$translation_array = array(
107107
'isPro' => $type,
108-
'proTeaser' => Visualizer_Plugin::PRO_TEASER_URL,
108+
'proTeaser' => tsdk_utmify( Visualizer_Plugin::PRO_TEASER_URL, 'blockupsell'),
109109
'absurl' => VISUALIZER_ABSURL,
110110
'charts' => Visualizer_Module_Admin::_getChartTypesLocalized(),
111111
'adminPage' => menu_page_url( 'visualizer', false ),

classes/Visualizer/Module/Admin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ public function handleGetProSubMenu() {
726726
jQuery( document ).ready( function() {
727727
jQuery( '#toplevel_page_visualizer' ).on( 'click', 'li:not(.wp-submenu-head, .wp-first-item):eq(2)', function( e ) {
728728
e.preventDefault();
729-
window.open( 'https://themeisle.com/plugins/visualizer-charts-and-graphs/upgrade/#pricing', '_blank' );
729+
window.open( '<?php echo tsdk_utmify( 'https://themeisle.com/plugins/visualizer-charts-and-graphs/upgrade/', 'toplevel' ); ?>', '_blank' );
730730
} );
731731
} );
732732
</script>
@@ -1086,7 +1086,7 @@ public function getPluginMetaLinks( $plugin_meta, $plugin_file ) {
10861086
);
10871087
// flattr link
10881088
$plugin_meta[] = sprintf(
1089-
'<a style="color:red" href="' . Visualizer_Plugin::PRO_TEASER_URL . '" target="_blank">%s</a>',
1089+
'<a style="color:red" href="' . tsdk_utmify( Visualizer_Plugin::PRO_TEASER_URL, 'pluginrow' ) . '" target="_blank">%s</a>',
10901090
esc_html__( 'Pro Addon', 'visualizer' )
10911091
);
10921092
}

classes/Visualizer/Module/Sources.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function addProUpsell( $old, $feature = null ) {
146146
$return .= ' <div class="only-pro-container">';
147147
$return .= ' <div class="only-pro-inner">';
148148
$return .= ' <p>' . $msg . '</p>';
149-
$return .= ' <a target="_blank" href="' . Visualizer_Plugin::PRO_TEASER_URL . '" title="' . __( 'Buy now', 'visualizer' ) . '">' . __( 'Buy now', 'visualizer' ) . '</a>';
149+
$return .= ' <a target="_blank" href="' . tsdk_utmify( Visualizer_Plugin::PRO_TEASER_URL, esc_attr( $feature ) ) . '" title="' . __( 'Buy now', 'visualizer' ) . '">' . __( 'Buy now', 'visualizer' ) . '</a>';
150150
$return .= ' </div>';
151151
$return .= ' </div>';
152152
$return .= '</div>';

classes/Visualizer/Plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class Visualizer_Plugin {
9898
const CF_CHART_URL = 'visualizer-chart-url';
9999
const CF_CHART_SCHEDULE = 'visualizer-chart-schedule';
100100
// Added by Ash/Upwork
101-
const PRO_TEASER_URL = 'https://themeisle.com/plugins/visualizer-charts-and-graphs/upgrade/#pricing';
101+
const PRO_TEASER_URL = 'https://themeisle.com/plugins/visualizer-charts-and-graphs/upgrade/';
102102
const PRO_TEASER_TITLE = 'Check PRO version ';
103103

104104
const CF_CHART_CACHE = 'visualizer-chart-cache';

classes/Visualizer/Render/Library.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ private function _renderSidebar() {
397397
echo '<li><svg class="icon list-icon"><use xlink:href="#list-icon"></use></svg>' . __( 'Frontend editor', 'visualizer' ) . '</li>';
398398
echo '<li><svg class="icon list-icon"><use xlink:href="#list-icon"></use></svg>' . __( 'Private charts', 'visualizer' ) . '</li>';
399399
echo '<li><svg class="icon list-icon"><use xlink:href="#list-icon"></use></svg>' . __( 'Auto-sync with online files', 'visualizer' ) . '</li></ul>';
400-
echo '<p><a href="' . str_replace( '#pricing', '#features', Visualizer_Plugin::PRO_TEASER_URL ) . '" target="_blank" class="button button-primary">' . __( 'View more features', 'visualizer' ) . '</a></p>';
400+
echo '<p><a href="' . tsdk_utmify( Visualizer_Plugin::PRO_TEASER_URL, 'sidebarupsell' ) . '" target="_blank" class="button button-primary">' . __( 'View more features', 'visualizer' ) . '</a></p>';
401401
echo '</div>';
402402
echo '</div>';
403403
echo '</div>';

classes/Visualizer/Render/Page/Types.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ protected function _renderContent() {
6161
}
6262
echo '<div class="type-box type-box-', $type, $lib_classes, '">';
6363
if ( ! $array['enabled'] ) {
64-
echo "<a class='pro-upsell' href='" . Visualizer_Plugin::PRO_TEASER_URL . "' target='_blank'>";
64+
echo "<a class='pro-upsell' href='" . tsdk_utmify( Visualizer_Plugin::PRO_TEASER_URL, 'charttypes' ) . "' target='_blank'>";
6565
echo "<span class='visualizder-pro-label'>" . __( 'PREMIUM', 'visualizer' ) . '</span>';
6666
}
6767
echo '<label class="type-label', $type === $this->type ? ' type-label-selected' : '', '">';

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
}
4848
},
4949
"require-dev": {
50-
"wp-coding-standards/wpcs": "1.2.1",
50+
"wp-coding-standards/wpcs": "^2.3",
5151
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
5252
"phpcompatibility/phpcompatibility-wp": "*"
5353
}

composer.lock

Lines changed: 17 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/*
33
Plugin Name: Visualizer: Tables and Charts for WordPress
4-
Plugin URI: https://themeisle.com/plugins/visualizer-charts-and-graphs-lite/
4+
Plugin URI: https://themeisle.com/plugins/visualizer-charts-and-graphs/
55
Description: A simple, easy to use and quite powerful tool to create, manage and embed interactive charts into your WordPress posts and pages. The plugin uses Google Visualization API to render charts, which supports cross-browser compatibility (adopting VML for older IE versions) and cross-platform portability to iOS and new Android releases.
66
Version: 3.8.0
77
Author: Themeisle
@@ -69,6 +69,7 @@ function visualizer_launch() {
6969
define( 'VISUALIZER_BASENAME', plugin_basename( __FILE__ ) );
7070
define( 'VISUALIZER_ABSURL', plugins_url( '/', __FILE__ ) );
7171
define( 'VISUALIZER_ABSPATH', dirname( __FILE__ ) );
72+
define( 'VISUALIZER_DIRNAME', basename( VISUALIZER_ABSPATH ) );
7273
define( 'VISUALIZER_REST_VERSION', 1 );
7374
// if the below is true, then the js/customization.js in the plugin folder will be used instead of the one in the uploads folder (if it exists).
7475
// this is also used in Block.php
@@ -132,7 +133,16 @@ function visualizer_launch() {
132133
}
133134
add_filter( 'themeisle_sdk_products', 'visualizer_register_sdk', 10, 1 );
134135
add_filter( 'pirate_parrot_log', 'visualizer_register_parrot', 10, 1 );
135-
136+
add_filter(
137+
'themeisle_sdk_compatibilities/' . VISUALIZER_DIRNAME, function ( $compatibilities ) {
138+
$compatibilities['VisualizerPRO'] = array(
139+
'basefile' => defined( 'VISUALIZER_PRO_BASEFILE' ) ? VISUALIZER_PRO_BASEFILE : '',
140+
'required' => '1.8',
141+
'tested_up' => '1.12',
142+
);
143+
return $compatibilities;
144+
}
145+
);
136146
}
137147

138148
/**

phpcs.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
<exclude name="Squiz.Commenting.InlineComment.InvalidEndChar" />
1818
<exclude name="Squiz.Commenting.InlineComment.NotCapital" />
1919
<exclude name="Squiz.Commenting.FileComment" />
20+
<exclude name="Generic.Arrays.DisallowShortArraySyntax.Found" />
21+
<exclude name="PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket" />
2022
<exclude name="WordPress.PHP.YodaConditions.NotYoda" />
2123
<exclude name="Squiz.PHP.DisallowMultipleAssignments" />
2224
<exclude name="WordPress.NamingConvention.ValidVariableName.StringNotSnakeCase" />

0 commit comments

Comments
 (0)