|
2 | 2 | namespace CBXWPBookmark; |
3 | 3 |
|
4 | 4 | use CBXWPBookmark\CBXWPBookmarkSettings; |
| 5 | +use Exception; |
| 6 | + |
5 | 7 | //use CBXWPBookmark\Helpers\CBXWPBookmarkHelper; |
6 | 8 |
|
7 | 9 | // If this file is called directly, abort. |
@@ -809,6 +811,10 @@ public function add_edit_category() { |
809 | 811 | public function cbxwpbookmark_autocreate_page() { |
810 | 812 | check_ajax_referer( 'cbxbookmarknonce', 'security' ); |
811 | 813 |
|
| 814 | + if ( ! current_user_can( 'manage_options' ) ) { |
| 815 | + throw new Exception( esc_html__( 'Sorry, you don\'t have enough permission!', 'cbxwpbookmark' ) ); |
| 816 | + } |
| 817 | + |
812 | 818 | //create pages |
813 | 819 | \CBXWPBookmarkHelper::cbxbookmark_create_pages(); //create the shortcode page |
814 | 820 |
|
@@ -894,7 +900,7 @@ public function plugin_activate_upgrade_notices() { |
894 | 900 | } |
895 | 901 |
|
896 | 902 | if ( get_transient( 'cbxwpbookmark_proaddon_deactivated' ) ) { |
897 | | - echo '<div class="notice notice-success is-dismissible" style="border-color: #6648fe !important;">'; |
| 903 | + echo '<div class="notice notice-warning is-dismissible" style="border-color: #6648fe !important;">'; |
898 | 904 |
|
899 | 905 | echo '<p>'; |
900 | 906 | esc_html_e( 'Current version of CBX Bookmark & Favorite Pro Addon is not compatible with core CBX Bookmark & Favorite. CBX Bookmark & Favorite Pro Addon is forced deactivate. Update CBX Bookmark & Favorite Pro Addon to V2.0.0 or later.', 'cbxwpbookmark' ); |
@@ -964,22 +970,9 @@ public function pro_addon_compatibility_campaign() { |
964 | 970 | } |
965 | 971 |
|
966 | 972 | //if the pro addon is active or installed |
967 | | - //phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound |
968 | | - if ( in_array( 'cbxwpbookmarkaddon/cbxwpbookmarkaddon.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) || defined( 'CBXWPBOOKMARKADDON_PLUGIN_NAME' ) ) { |
969 | | - //plugin is activated |
970 | | - |
971 | | - $pro_plugin_version = CBXWPBOOKMARKADDON_PLUGIN_VERSION; |
972 | | - //$core_plugin_version = CBXWPBOOKMARK_PLUGIN_VERSION; |
973 | | - |
974 | | - if ( version_compare( $pro_plugin_version, '1.1.10', '<' ) ) { |
975 | | - /* translators: %s: bookmark pro plugin version */ |
976 | | - echo '<div style="border-left-color: #005ae0;" class="notice notice-success is-dismissible"><p>' . sprintf( esc_html__( 'CBX Bookmark Pro Addon V%s or any previous version is not 100%% compatible with CBX Bookmark Core V1.5.3 or later. Please update CBX Bookmark Pro Addon to version 1.1.10 or latest. - Codeboxr Team', 'cbxwpbookmark' ), $pro_plugin_version ) . '</p></div>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
977 | | - } |
978 | | - |
979 | | - |
980 | | - } else { |
| 973 | + if (!defined( 'CBXWPBOOKMARKADDON_PLUGIN_NAME' )) { |
981 | 974 | /* translators: %s: bookmark product description url */ |
982 | | - echo '<div style="border-left-color: #005ae0;" class="notice notice-success is-dismissible"><p>' . sprintf( wp_kses( __( '<a target="_blank" href="%s">CBX Bookmark Pro Addon</a> has extended features, settings, widgets and shortcodes. try it - Codeboxr Team', 'cbxwpbookmark' ), [ 'a' => [ 'href' => [], 'target' => [] ] ] ), 'https://codeboxr.com/product/cbx-wordpress-bookmark/' ) . '</p></div>'; |
| 975 | + echo '<div style="border-left-color: #005ae0;" class="notice notice-warning is-dismissible"><p>' . sprintf( wp_kses( __( '<a target="_blank" href="%s">CBX Bookmark Pro Addon</a> has extended features, settings, widgets and shortcodes. try it - Codeboxr Team', 'cbxwpbookmark' ), [ 'a' => [ 'href' => [], 'target' => [] ] ] ), 'https://codeboxr.com/product/cbx-wordpress-bookmark/' ) . '</p></div>'; |
983 | 976 | } |
984 | 977 | }//end pro_addon_compatibility_campaign |
985 | 978 |
|
@@ -1019,26 +1012,14 @@ public function plugin_row_meta( $links_array, $plugin_file_name, $plugin_data, |
1019 | 1012 | } |
1020 | 1013 |
|
1021 | 1014 | $links_array[] = '<a target="_blank" style="color:#005ae0 !important; font-weight: bold;" href="https://wordpress.org/support/plugin/cbxwpbookmark/" aria-label="' . esc_attr__( 'Free Support', 'cbxwpbookmark' ) . '">' . esc_html__( 'Free Support', 'cbxwpbookmark' ) . '</a>'; |
1022 | | - |
1023 | 1015 | $links_array[] = '<a target="_blank" style="color:#005ae0 !important; font-weight: bold;" href="https://wordpress.org/plugins/cbxwpbookmark/#reviews" aria-label="' . esc_attr__( 'Reviews', 'cbxwpbookmark' ) . '">' . esc_html__( 'Reviews', 'cbxwpbookmark' ) . '</a>'; |
1024 | | - |
1025 | 1016 | $links_array[] = '<a target="_blank" style="color:#005ae0 !important; font-weight: bold;" href="https://codeboxr.com/doc/cbxwpbookmark-doc/" aria-label="' . esc_attr__( 'Documentation', 'cbxwpbookmark' ) . '">' . esc_html__( 'Documentation', 'cbxwpbookmark' ) . '</a>'; |
1026 | | - |
1027 | | - |
1028 | | - //phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound |
1029 | | - if ( in_array( 'cbxwpbookmarkaddon/cbxwpbookmarkaddon.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) || defined( 'CBXWPBOOKMARKADDON_PLUGIN_NAME' ) ) { |
1030 | | - |
1031 | | - } else { |
1032 | | - $links_array[] = '<a target="_blank" style="color:#005ae0 !important; font-weight: bold;" href="https://codeboxr.com/product/cbx-wordpress-bookmark/" aria-label="' . esc_attr__( 'Try Pro Addon', 'cbxwpbookmark' ) . '">' . esc_html__( 'Try Pro Addon', 'cbxwpbookmark' ) . '</a>'; |
1033 | | - } |
| 1017 | + $links_array[] = '<a target="_blank" style="color:#005ae0 !important; font-weight: bold;" href="https://codeboxr.com/product/cbx-wordpress-bookmark/" aria-label="' . esc_attr__( 'Try Pro Addon', 'cbxwpbookmark' ) . '">' . esc_html__( 'Try Pro Addon', 'cbxwpbookmark' ) . '</a>'; |
1034 | 1018 | } |
1035 | 1019 |
|
1036 | 1020 | return $links_array; |
1037 | 1021 | }//end plugin_row_meta |
1038 | 1022 |
|
1039 | | - |
1040 | | - |
1041 | | - |
1042 | 1023 | /** |
1043 | 1024 | * User's bookmarks listing screen option columns |
1044 | 1025 | * |
@@ -1089,6 +1070,8 @@ public function settings_reset_load() { |
1089 | 1070 | //security check |
1090 | 1071 | check_ajax_referer( 'settingsnonce', 'security' ); |
1091 | 1072 |
|
| 1073 | + |
| 1074 | + |
1092 | 1075 | $msg = []; |
1093 | 1076 | $msg['html'] = ''; |
1094 | 1077 | $msg['message'] = esc_html__( 'Bookmark reset setting html loaded successfully', 'cbxwpbookmark' ); |
|
0 commit comments