11<?php
2+
23namespace CBXSCRatingReview ;
34
45// Prevent direct file access
@@ -55,8 +56,10 @@ public function add_module_to_script( $tag, $handle, $src ) {
5556 */
5657 public function plugin_action_links ( $ links ) {
5758 $ action_links = [
58- 'settings ' => '<a style="color: #6648fe !important; font-weight: bold;" href=" ' . esc_url (admin_url ( 'admin.php?page=cbxscratingreviewsettings ' )) . '" aria-label=" ' . esc_attr__ ( 'View settings ' , 'cbxscratingreview ' ) . '"> ' . esc_html__ ( 'Settings ' , 'cbxscratingreview ' ) . '</a> ' ,
59- 'translation ' => '<a style="color: #6648fe !important; font-weight: bold;" target="_blank" href="https://translate.wordpress.org/projects/wp-plugins/cbxscratingreview/" aria-label=" ' . esc_attr__ ( 'Translations ' , 'cbxscratingreview ' ) . '"> ' . esc_html__ ( 'Translations ' , 'cbxscratingreview ' ) . '</a> ' ,
59+ 'settings ' => '<a style="color: #6648fe !important; font-weight: bold;" href=" ' . esc_url ( admin_url ( 'admin.php?page=cbxscratingreviewsettings ' ) ) . '" aria-label=" ' . esc_attr__ ( 'View settings ' ,
60+ 'cbxscratingreview ' ) . '"> ' . esc_html__ ( 'Settings ' , 'cbxscratingreview ' ) . '</a> ' ,
61+ 'translation ' => '<a style="color: #6648fe !important; font-weight: bold;" target="_blank" href="https://translate.wordpress.org/projects/wp-plugins/cbxscratingreview/" aria-label=" ' . esc_attr__ ( 'Translations ' ,
62+ 'cbxscratingreview ' ) . '"> ' . esc_html__ ( 'Translations ' , 'cbxscratingreview ' ) . '</a> ' ,
6063 ];
6164
6265 return array_merge ( $ action_links , $ links );
@@ -66,10 +69,10 @@ public function plugin_action_links( $links ) {
6669 /**
6770 * Add custom links to plugin row meta.
6871 *
69- * @param array $links_array Existing plugin meta links.
70- * @param string $plugin_file_name Plugin file name.
71- * @param array $plugin_data Plugin data.
72- * @param string $status Plugin status.
72+ * @param array $links_array Existing plugin meta links.
73+ * @param string $plugin_file_name Plugin file name.
74+ * @param array $plugin_data Plugin data.
75+ * @param string $status Plugin status.
7376 *
7477 * @return array
7578 */
@@ -82,12 +85,12 @@ public function plugin_row_meta( $links_array, $plugin_file_name, $plugin_data,
8285 $ base_class = 'cbxscratingreview-plugin-link ' ;
8386
8487 $ links = array (
85- 'free_support ' => array (
88+ 'free_support ' => array (
8689 'url ' => 'https://wordpress.org/support/plugin/cbxscratingreview/ ' ,
8790 'text ' => esc_html__ ( 'Free Support ' , 'cbxscratingreview ' ),
8891 'aria ' => esc_attr ( 'Free Support ' , 'cbxscratingreview ' ),
8992 ),
90- 'reviews ' => array (
93+ 'reviews ' => array (
9194 'url ' => 'https://wordpress.org/plugins/cbxscratingreview/#reviews ' ,
9295 'text ' => esc_html__ ( 'Reviews ' , 'cbxscratingreview ' ),
9396 'aria ' => esc_attr ( 'Reviews ' , 'cbxscratingreview ' ),
@@ -167,9 +170,12 @@ public function plugin_activate_upgrade_notices() {
167170 if ( get_transient ( 'cbxscratingreview_activated_notice ' ) ) {
168171 echo '<div style="border-left: 2px solid #6648fe;" class="notice notice-success is-dismissible"> ' ;
169172 /* translators: %s: Plugin version */
170- echo '<p> ' . sprintf ( wp_kses ( __ ( 'Thanks for installing/deactivating <strong>CBX 5 Star Rating & Review</strong> V%s - Codeboxr Team ' , 'cbxscratingreview ' ), [ 'a ' => ['target ' => [] , 'href ' => []] ]), esc_html (CBXSCRATINGREVIEW_PLUGIN_VERSION )) . '</p> ' ;
173+ echo '<p> ' . sprintf ( wp_kses ( __ ( 'Thanks for installing/deactivating <strong>CBX 5 Star Rating & Review</strong> V%s - Codeboxr Team ' , 'cbxscratingreview ' ),
174+ [ 'a ' => [ 'target ' => [], 'href ' => [] ] ] ), esc_html ( CBXSCRATINGREVIEW_PLUGIN_VERSION ) ) . '</p> ' ;
171175 /* translators: %1$s: Setting url , %2$s: Plugin url */
172- echo '<p> ' . sprintf ( wp_kses ( __ ( 'Check <a href="%1$s">Plugin Setting</a> | <a href="%2$s" target="_blank">Learn More</a> ' , 'cbxscratingreview ' ), [ 'a ' => ['target ' => [] , 'href ' => []] ]), esc_url (admin_url ( 'admin.php?page=cbxscratingreviewsettings ' )), esc_url ('https://codeboxr.com/product/cbx-single-criteria-rating-review-for-wordpress/ ' ) ) . '</p> ' ;
176+ echo '<p> ' . sprintf ( wp_kses ( __ ( 'Check <a href="%1$s">Plugin Setting</a> | <a href="%2$s" target="_blank">Learn More</a> ' , 'cbxscratingreview ' ),
177+ [ 'a ' => [ 'target ' => [], 'href ' => [] ] ] ), esc_url ( admin_url ( 'admin.php?page=cbxscratingreviewsettings ' ) ),
178+ esc_url ( 'https://codeboxr.com/product/cbx-single-criteria-rating-review-for-wordpress/ ' ) ) . '</p> ' ;
173179 echo '</div> ' ;
174180 // Delete the transient so we don't keep displaying the activation message
175181 delete_transient ( 'cbxscratingreview_activated_notice ' );
@@ -182,9 +188,12 @@ public function plugin_activate_upgrade_notices() {
182188 if ( get_transient ( 'cbxscratingreview_upgraded_notice ' ) ) {
183189 echo '<div style="border-left: 2px solid #6648fe;" class="notice notice-success is-dismissible"> ' ;
184190 /* translators: %s: Plugin version */
185- echo '<p> ' . sprintf ( wp_kses ( __ ( 'Thanks for upgrading <strong>CBX 5 Star Rating & Review</strong> V%s , enjoy the new features and bug fixes - Codeboxr Team ' , 'cbxscratingreview ' ) , [ 'a ' => ['target ' => [] , 'href ' => []] ]), esc_html (CBXSCRATINGREVIEW_PLUGIN_VERSION ) ) . '</p> ' ;
191+ echo '<p> ' . sprintf ( wp_kses ( __ ( 'Thanks for upgrading <strong>CBX 5 Star Rating & Review</strong> V%s , enjoy the new features and bug fixes - Codeboxr Team ' , 'cbxscratingreview ' ),
192+ [ 'a ' => [ 'target ' => [], 'href ' => [] ] ] ), esc_html ( CBXSCRATINGREVIEW_PLUGIN_VERSION ) ) . '</p> ' ;
186193 /* translators: %1$s: Setting url , %2$s: Plugin url */
187- echo '<p> ' . sprintf ( wp_kses ( __ ( 'Check <a href="%1$s">Plugin Setting</a> | <a href="%2$s" target="_blank">Learn More</a> ' , 'cbxscratingreview ' ), [ 'a ' => ['target ' => [] , 'href ' => []] ]), esc_url (admin_url ( 'admin.php?page=cbxscratingreviewsettings ' )), esc_url ('https://codeboxr.com/product/cbx-single-criteria-rating-review-for-wordpress/ ' ) ) . '</p> ' ;
194+ echo '<p> ' . sprintf ( wp_kses ( __ ( 'Check <a href="%1$s">Plugin Setting</a> | <a href="%2$s" target="_blank">Learn More</a> ' , 'cbxscratingreview ' ),
195+ [ 'a ' => [ 'target ' => [], 'href ' => [] ] ] ), esc_url ( admin_url ( 'admin.php?page=cbxscratingreviewsettings ' ) ),
196+ esc_url ( 'https://codeboxr.com/product/cbx-single-criteria-rating-review-for-wordpress/ ' ) ) . '</p> ' ;
188197 echo '</div> ' ;
189198 // Delete the transient so we don't keep displaying the activation message
190199 delete_transient ( 'cbxscratingreview_upgraded_notice ' );
@@ -199,10 +208,12 @@ public function plugin_activate_upgrade_notices() {
199208 */
200209 public function pro_addon_compatibility_campaign () {
201210 //if the pro addon is active or installed
202- if ( !defined ( 'CBXSCRATINGREVIEWPRO_PLUGIN_NAME ' ) ) {
211+ if ( ! defined ( 'CBXSCRATINGREVIEWPRO_PLUGIN_NAME ' ) ) {
203212
204213 /* translators: %s: Plugin url */
205- echo '<div style="border-left: 2px solid #6648fe;" class="notice notice-success is-dismissible"><p> ' . sprintf ( wp_kses ( __ ( '<a target="_blank" href="%s">CBX 5 Star Rating & Review Pro Addon</a> has lots of pro and extended features, try it - Codeboxr Team ' , 'cbxscratingreview ' ), [ 'a ' => ['target ' => [] , 'href ' => []] ] ) , esc_url ('https://codeboxr.com/product/cbx-single-criteria-rating-review-for-wordpress-pro-addon/ ' ) ) . '</p></div> ' ;
214+ echo '<div style="border-left: 2px solid #6648fe;" class="notice notice-success is-dismissible"><p> ' . sprintf ( wp_kses ( __ ( '<a target="_blank" href="%s">CBX 5 Star Rating & Review Pro Addon</a> has lots of pro and extended features, try it - Codeboxr Team ' ,
215+ 'cbxscratingreview ' ), [ 'a ' => [ 'target ' => [], 'href ' => [] ] ] ),
216+ esc_url ( 'https://codeboxr.com/product/cbx-single-criteria-rating-review-for-wordpress-pro-addon/ ' ) ) . '</p></div> ' ;
206217 }
207218 }//end pro_addon_compatibility_campaign
208219
@@ -214,24 +225,26 @@ public function pro_addon_compatibility_campaign() {
214225 *
215226 * @return void
216227 */
217- public function custom_message_after_plugin_row_proaddon ($ plugin_file , $ plugin_data) {
228+ public function custom_message_after_plugin_row_proaddon ( $ plugin_file , $ plugin_data ) {
218229 if ( $ plugin_file !== 'cbxscratingreviewpro/cbxscratingreviewpro.php ' ) {
219230 return ;
220231 }
221232
222233 //if pro addon is active then ignore this notification from core
223- if (defined ('CBXSCRATINGREVIEWPRO_PLUGIN_NAME ' )) return ;
234+ if ( defined ( 'CBXSCRATINGREVIEWPRO_PLUGIN_NAME ' ) ) {
235+ return ;
236+ }
224237
225- $ pro_addon_version = CBXSCRatingReviewHelper::get_any_plugin_version ('cbxscratingreviewpro/cbxscratingreviewpro.php ' );
226- $ pro_latest_version = CBXSCRATINGREVIEWPRO_PLUGIN_VERSION ;
238+ $ pro_addon_version = CBXSCRatingReviewHelper::get_any_plugin_version ( 'cbxscratingreviewpro/cbxscratingreviewpro.php ' );
239+ $ pro_latest_version = CBXSCRATINGREVIEW_PRO_VERSION ;
227240
228- if ( $ pro_addon_version !== '' && version_compare ( $ pro_addon_version , $ pro_latest_version , '< ' ) ){
241+ if ( $ pro_addon_version !== '' && version_compare ( $ pro_addon_version , $ pro_latest_version , '< ' ) ) {
229242 //$plugin_manual_update = 'https://codeboxr.com/manual-update-pro-addon/';
230243
231244
232-
233245 /* translators:translators: %s: plugin setting url for licence */
234- $ custom_message = wp_kses (sprintf ( __ ( '<strong>Note:</strong> CBX 5 Star Rating & Review Pro Addon is custom plugin. <strong style="color: red;">It seems this plugin \'s current version is older than %2$s . To get the latest pro addon features, this plugin needs to upgrade to %2$s or later.</strong> ' , 'cbxscratingreview ' ), $ pro_latest_version , $ pro_latest_version ), ['strong ' => ['style ' => []],'a ' => ['href ' => [], 'target ' => []]]);
246+ $ custom_message = wp_kses ( sprintf ( __ ( '<strong>Note:</strong> CBX 5 Star Rating & Review Pro Addon is custom plugin. <strong style="color: red;">It seems this plugin \'s current version is older than %2$s . To get the latest pro addon features, this plugin needs to upgrade to %2$s or later.</strong> ' ,
247+ 'cbxscratingreview ' ), $ pro_latest_version , $ pro_latest_version ), [ 'strong ' => [ 'style ' => [] ], 'a ' => [ 'href ' => [], 'target ' => [] ] ] );
235248
236249 // Output a row with custom content
237250 echo '<tr class="plugin-update-tr">
0 commit comments