| 1 |
<?php |
| 2 |
/** |
| 3 |
* Admin boot |
| 4 |
* @author Webcraftic <wordpress.webraftic@gmail.com> |
| 5 |
* @copyright Webcraftic 25.05.2017 |
| 6 |
* @version 1.0 |
| 7 |
*/ |
| 8 |
|
| 9 |
// Exit if accessed directly |
| 10 |
if( !defined('ABSPATH') ) { |
| 11 |
exit; |
| 12 |
} |
| 13 |
|
| 14 |
function wbcr_cmp_rating_widget_url($page_url, $plugin_name) |
| 15 |
{ |
| 16 |
if( $plugin_name == WCM_Plugin::app()->getPluginName() ) { |
| 17 |
return 'https://goo.gl/v4QkW5'; |
| 18 |
} |
| 19 |
|
| 20 |
return $page_url; |
| 21 |
} |
| 22 |
|
| 23 |
add_filter('wbcr_factory_pages_401_imppage_rating_widget_url', 'wbcr_cmp_rating_widget_url', 10, 2); |
| 24 |
|
| 25 |
function wbcr_cmp_group_options($options) |
| 26 |
{ |
| 27 |
$options[] = array( |
| 28 |
'name' => 'disable_comments', |
| 29 |
'title' => __('Disable comments on the entire site', 'comments-plus'), |
| 30 |
'tags' => array('disable_all_comments'), |
| 31 |
'values' => array('disable_all_comments' => 'disable_comments') |
| 32 |
); |
| 33 |
$options[] = array( |
| 34 |
'name' => 'disable_comments_for_post_types', |
| 35 |
'title' => __('Select post types', 'comments-plus'), |
| 36 |
'tags' => array() |
| 37 |
); |
| 38 |
$options[] = array( |
| 39 |
'name' => 'comment_text_convert_links_pseudo', |
| 40 |
'title' => __('Replace external links in comments on the JavaScript code', 'comments-plus'), |
| 41 |
'tags' => array('recommended', 'seo_optimize') |
| 42 |
); |
| 43 |
$options[] = array( |
| 44 |
'name' => 'pseudo_comment_author_link', |
| 45 |
'title' => __('Replace external links from comment authors on the JavaScript code', 'comments-plus'), |
| 46 |
'tags' => array('recommended', 'seo_optimize') |
| 47 |
); |
| 48 |
$options[] = array( |
| 49 |
'name' => 'remove_x_pingback', |
| 50 |
'title' => __('Disable X-Pingback', 'comments-plus'), |
| 51 |
'tags' => array('recommended', 'defence', 'disable_all_comments') |
| 52 |
); |
| 53 |
$options[] = array( |
| 54 |
'name' => 'remove_url_from_comment_form', |
| 55 |
'title' => __('Remove field "site" in comment form', 'comments-plus'), |
| 56 |
'tags' => array() |
| 57 |
); |
| 58 |
|
| 59 |
return $options; |
| 60 |
} |
| 61 |
|
| 62 |
add_filter("wbcr_clearfy_group_options", 'wbcr_cmp_group_options'); |
| 63 |
|
| 64 |
function wbcr_cmp_allow_quick_mods($mods) |
| 65 |
{ |
| 66 |
$mods['disable_all_comments'] = array( |
| 67 |
'title' => __('One click disable all comments', 'comments-plus'), |
| 68 |
'icon' => 'dashicons-testimonial' |
| 69 |
); |
| 70 |
|
| 71 |
return $mods; |
| 72 |
} |
| 73 |
|
| 74 |
add_filter("wbcr_clearfy_allow_quick_mods", 'wbcr_cmp_allow_quick_mods'); |
| 75 |
|
| 76 |
function wbcr_cmp_set_plugin_meta($links, $file) |
| 77 |
{ |
| 78 |
if( $file == WCM_PLUGIN_BASE ) { |
| 79 |
|
| 80 |
$url = 'https://clearfy.pro'; |
| 81 |
|
| 82 |
if( get_locale() == 'ru_RU' ) { |
| 83 |
$url = 'https://ru.clearfy.pro'; |
| 84 |
} |
| 85 |
|
| 86 |
$url .= '?utm_source=wordpress.org&utm_campaign=' . WCM_Plugin::app()->getPluginName(); |
| 87 |
|
| 88 |
$links[] = '<a href="' . $url . '" style="color: #FF5722;font-weight: bold;" target="_blank">' . __('Get ultimate plugin free', 'comments-plus') . '</a>'; |
| 89 |
} |
| 90 |
|
| 91 |
return $links; |
| 92 |
} |
| 93 |
|
| 94 |
if( !defined('LOADING_COMMENTS_PLUS_AS_ADDON') ) { |
| 95 |
add_filter('plugin_row_meta', 'wbcr_cmp_set_plugin_meta', 10, 2); |
| 96 |
} |
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|