Skip to content

Commit 0ee11a9

Browse files
committed
map 2.0.3 released
1 parent c84f201 commit 0ee11a9

File tree

12 files changed

+106
-156
lines changed

12 files changed

+106
-156
lines changed

cbxgooglemap.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* Plugin Name: CBX Map for Google Map & OpenStreetMap
1717
* Plugin URI: https://codeboxr.com/product/cbx-google-map-for-wordpress/
1818
* Description: Easy responsive embed of google map and openstreet map
19-
* Version: 2.0.2
19+
* Version: 2.0.3
2020
* Author: Codeboxr
2121
* Author URI: https://codeboxr.com
2222
* License: GPL-2.0+
@@ -33,13 +33,14 @@
3333
}
3434

3535
defined( 'CBXGOOGLEMAP_PLUGIN_NAME' ) or define( 'CBXGOOGLEMAP_PLUGIN_NAME', 'cbxgooglemap' );
36-
defined( 'CBXGOOGLEMAP_PLUGIN_VERSION' ) or define( 'CBXGOOGLEMAP_PLUGIN_VERSION', '2.0.2' );
36+
defined( 'CBXGOOGLEMAP_PLUGIN_VERSION' ) or define( 'CBXGOOGLEMAP_PLUGIN_VERSION', '2.0.3' );
3737
defined( 'CBXGOOGLEMAP_BASE_NAME' ) or define( 'CBXGOOGLEMAP_BASE_NAME', plugin_basename( __FILE__ ) );
3838
defined( 'CBXGOOGLEMAP_ROOT_PATH' ) or define( 'CBXGOOGLEMAP_ROOT_PATH', plugin_dir_path( __FILE__ ) );
3939
defined( 'CBXGOOGLEMAP_ROOT_URL' ) or define( 'CBXGOOGLEMAP_ROOT_URL', plugin_dir_url( __FILE__ ) );
4040

4141
defined( 'CBXGOOGLEMAP_WP_MIN_VERSION' ) or define( 'CBXGOOGLEMAP_WP_MIN_VERSION', '5.3' );
4242
defined( 'CBXGOOGLEMAP_PHP_MIN_VERSION' ) or define( 'CBXGOOGLEMAP_PHP_MIN_VERSION', '7.4' );
43+
defined( 'CBXGOOGLEMAP_PRO_VERSION' ) or define( 'CBXGOOGLEMAP_PRO_VERSION', '2.0.3' );
4344

4445
// Include the main class
4546
if ( ! class_exists( 'CBXGoogleMap', false ) ) {

composer.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
"description": "cbx googlemap plugin",
44
"type": "library",
55
"license": "MIT",
6-
"config": {
7-
"vendor-dir": "vendor"
8-
},
96
"require": {
107
"enshrined/svg-sanitize": "dev-master"
118
},
@@ -19,5 +16,11 @@
1916
]
2017
},
2118
"replace": {
19+
"symfony/console": "*",
20+
"symfony/translation": "*",
21+
"symfony/translation-contracts": "*"
22+
},
23+
"config": {
24+
"platform-check": false
2225
}
2326
}

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

includes/CBXGoogleMap.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,12 @@ public static function instance() {
116116
private function define_common_hooks() {
117117
$misc = new CBXGoogleMapMisc();
118118

119-
//upgrade process
120-
//add_action('admin_init', [$misc, 'admin_init_upgrader_process']);
121-
//add_action( 'upgrader_process_complete', [ $misc, 'plugin_upgrader_process_complete' ], 10, 2 );
122-
123119
add_action( 'plugins_loaded', [ $misc, 'plugin_upgrader_process_complete' ] );
124120
add_action( 'admin_notices', [ $misc, 'plugin_activate_upgrade_notices' ] );
125121
add_filter( 'plugin_action_links_' . CBXGOOGLEMAP_BASE_NAME, [ $misc, 'plugin_listing_setting_link' ] );
126122
add_filter( 'plugin_row_meta', [ $misc, 'custom_plugin_row_meta' ], 10, 4 );
127123

124+
add_action( 'activated_plugin', [ $misc, 'check_pro_addon' ] );
128125
add_action( 'init', [ $misc, 'check_pro_addon' ] );
129126
add_action( 'after_plugin_row_cbxgooglemappro/cbxgooglemappro.php', [
130127
$misc,

includes/CBXGoogleMapMisc.php

Lines changed: 16 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -90,37 +90,26 @@ public function plugin_activate_upgrade_notices() {
9090
delete_transient( 'cbxgooglemap_upgraded_notice' );
9191
}//end cbxgooglemap_upgraded_notice
9292

93-
if ( get_transient( 'cbxgooglemappro_deactivated_notice' ) ) {
94-
echo '<div class="notice notice-error is-dismissible" style="border-color: red !important;">';
95-
echo '<p>' . wp_kses( __( 'Currently installed <strong>CBX Map for Google Map & OpenStreetMap Pro Addon</strong> version 1.0.5(or earlier) is not compatible with the latest version of core plugin CBX Map for Google Map & OpenStreetMap V1.1.12 or later. - Codeboxr Team',
96-
'cbxgooglemap' ), $kiss_html_arr ) . '</p>';
93+
if ( get_transient( 'cbxgooglemap_proaddon_deactivated' ) ) {
94+
echo '<div class="notice notice-warning is-dismissible" style="border-color: #6648fe !important;">';
95+
96+
echo '<p>';
97+
esc_html_e( 'Current version of CBX Map Pro Addon is not compatible with core CBX Map. CBX Map Pro Addon is forced deactivate. Update CBX Map Pro Addon to V2.0.0 or later.', 'cbxgooglemap' );
98+
99+
echo '</p>';
97100
echo '</div>';
98101

99-
delete_transient( 'cbxgooglemappro_deactivated_notice' );
102+
delete_transient( 'cbxgooglemap_proaddon_deactivated' );
100103
}//end checking cbxgooglemappro_deactivated_notice
101104
}//end plugin_activate_upgrade_notices
102105

103106
/**
104107
* Check plugin compatibility and pro addon install campaign
105108
*/
106109
public function pro_addon_compatibility_campaign() {
107-
if ( ! function_exists( 'is_plugin_active' ) ) {
108-
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
109-
}
110-
111110
//if the pro addon is active or installed
112-
//phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
113-
if ( defined( 'CBXGOOGLEMAPPRO_PLUGIN_NAME' ) || in_array( 'cbxgooglemappro/cbxgooglemappro.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
114-
//plugin is activated
115-
116-
$plugin_version = CBXGOOGLEMAPPRO_PLUGIN_VERSION;
117-
$pro_min_version = '2.0.0';
111+
if ( !defined( 'CBXGOOGLEMAPPRO_PLUGIN_NAME' )) {
118112

119-
if ( version_compare( $plugin_version, $pro_min_version, '<' ) ) {
120-
echo '<div class="notice notice-success is-dismissible"><p>' . esc_html__( 'CBX Map Pro Addon current version is not compatible with the latest CBX Map core plugin. Please update CBX Map Pro Addon to version 2.0.0 or later - Codeboxr Team', 'cbxgooglemap' ) . '</p></div>';
121-
}
122-
123-
} else {
124113
/* translators: %s: Plugin Link */
125114
$message = sprintf( __( 'CBX Map Pro Addon has distance search based listing, multiple marker in one map and more extra features, <a target="_blank" href="%s">try it</a> - Codeboxr Team', 'cbxgooglemap' ), esc_url( 'https://codeboxr.com/product/cbx-google-map-for-wordpress/' ) );
126115
echo '<div class="notice notice-success is-dismissible"><p>' . wp_kses_post( $message ) . '</p></div>';
@@ -170,7 +159,7 @@ public function check_pro_addon() {
170159
*/
171160
public function plugin_listing_setting_link( $links ) {
172161
return array_merge( [
173-
'settings' => '<a style="color:#39A96B; font-weight: bold;" target="_blank" href="' . esc_url( admin_url( 'edit.php?post_type=cbxgooglemap&page=cbxgooglemap_settings' ) ) . '">' . esc_attr__( 'Settings', 'cbxgooglemap' ) . '</a>'
162+
'settings' => '<a style="color:#5d5dff; font-weight: bold;" href="' . esc_url( admin_url( 'edit.php?post_type=cbxgooglemap&page=cbxgooglemap_settings' ) ) . '">' . esc_attr__( 'Settings', 'cbxgooglemap' ) . '</a>'
174163
], $links );
175164

176165
}//end plugin_listing_setting_link
@@ -191,21 +180,12 @@ public function plugin_listing_setting_link( $links ) {
191180
*/
192181
public function custom_plugin_row_meta( $links_array, $plugin_file_name, $plugin_data, $status ) {
193182
if ( strpos( $plugin_file_name, CBXGOOGLEMAP_BASE_NAME ) !== false ) {
194-
if ( ! function_exists( 'is_plugin_active' ) ) {
195-
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
196-
}
197-
198183

199-
$links_array[] = '<a style="color:#39A96B; font-weight: bold;" href="https://wordpress.org/support/plugin/cbxgooglemap/" target="_blank">' . esc_attr__( 'Free Support', 'cbxgooglemap' ) . '</a>';
200-
$links_array[] = '<a style="color:#39A96B; font-weight: bold;" href="https://wordpress.org/plugins/cbxgooglemap/#reviews" target="_blank">' . esc_attr__( 'Reviews', 'cbxgooglemap' ) . '</a>';
201-
$links_array[] = '<a target="_blank" style="color:#f44336 !important; font-weight: bold;" href="https://codeboxr.com/doc/cbxmap-doc/" aria-label="' . esc_attr__( 'Documentation', 'cbxgooglemap' ) . '">' . esc_html__( 'Documentation', 'cbxgooglemap' ) . '</a>';
202-
203-
//phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
204-
if ( in_array( 'cbxgooglemappro/cbxgooglemappro.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) || defined( 'CBXGOOGLEMAPPRO_PLUGIN_NAME' ) ) {
205-
$links_array[] = '<a style="color:#39A96B; font-weight: bold;" href="https://codeboxr.com/contact-us/" target="_blank">' . esc_attr__( 'Pro Support', 'cbxgooglemap' ) . '</a>';
206-
} else {
207-
$links_array[] = '<a target="_blank" style="color:#f44336 !important; font-weight: bold;" href="https://codeboxr.com/product/cbx-google-map-for-wordpress/#downloadarea" aria-label="' . esc_attr__( 'Try Pro Addon', 'cbxgooglemap' ) . '">' . esc_html__( 'Try Pro Addon', 'cbxgooglemap' ) . '</a>';
208-
}
184+
$links_array[] = '<a style="color:#5d5dff; font-weight: bold;" href="https://wordpress.org/support/plugin/cbxgooglemap/" target="_blank">' . esc_attr__( 'Free Support', 'cbxgooglemap' ) . '</a>';
185+
$links_array[] = '<a style="color:#5d5dff; font-weight: bold;" href="https://wordpress.org/plugins/cbxgooglemap/#reviews" target="_blank">' . esc_attr__( 'Reviews', 'cbxgooglemap' ) . '</a>';
186+
$links_array[] = '<a target="_blank" style="color:#5d5dff !important; font-weight: bold;" href="https://codeboxr.com/doc/cbxmap-doc/" aria-label="' . esc_attr__( 'Documentation', 'cbxgooglemap' ) . '">' . esc_html__( 'Documentation', 'cbxgooglemap' ) . '</a>';
187+
$links_array[] = '<a style="color:#5d5dff; font-weight: bold;" href="https://codeboxr.com/contact-us/" target="_blank">' . esc_attr__( 'Pro Support', 'cbxgooglemap' ) . '</a>';
188+
$links_array[] = '<a target="_blank" style="color:#f44336 !important; font-weight: bold;" href="https://codeboxr.com/product/cbx-google-map-for-wordpress/#downloadarea" aria-label="' . esc_attr__( 'Try Pro Addon', 'cbxgooglemap' ) . '">' . esc_html__( 'Try Pro Addon', 'cbxgooglemap' ) . '</a>';
209189
}
210190

211191
return $links_array;
@@ -229,7 +209,7 @@ public function custom_message_after_plugin_row_proaddon( $plugin_file, $plugin_
229209
}
230210

231211
$pro_addon_version = CBXGooglemapHelper::get_any_plugin_version( 'cbxgooglemappro/cbxgooglemappro.php' );
232-
$pro_latest_version = '2.0.2';
212+
$pro_latest_version = CBXGOOGLEMAP_PRO_VERSION;
233213

234214
if ( $pro_addon_version != '' && version_compare( $pro_addon_version, $pro_latest_version, '<' ) ) {
235215
// Custom message to display

includes/Helpers/CBXGooglemapHelper.php

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -512,25 +512,6 @@ public static function activate() {
512512
CBXGooglemapHelper::create_googlemap_post_type();
513513

514514
add_option( 'cbxgooglemap_flush_rewrite_rules', 'true' );
515-
//set_transient( 'cbxgooglemap_activated_notice', 1 );
516-
517-
518-
if ( ! function_exists( 'is_plugin_active' ) ) {
519-
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
520-
}
521-
522-
//phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
523-
if ( defined( 'CBXGOOGLEMAPPRO_PLUGIN_NAME' ) || in_array( 'cbxgooglemappro/cbxgooglemappro.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
524-
//plugin is activated
525-
526-
$plugin_version = CBXGOOGLEMAPPRO_PLUGIN_VERSION;
527-
528-
if ( version_compare( $plugin_version, '2.0.0', '<' ) ) {
529-
deactivate_plugins( 'cbxgooglemappro/cbxgooglemappro.php' );
530-
set_transient( 'cbxgooglemappro_deactivated_notice', 1 );
531-
}
532-
}
533-
534515
}//end activate
535516

536517
/**

0 commit comments

Comments
 (0)