first commit

This commit is contained in:
User A0264400
2026-04-01 23:20:16 +03:00
commit a766acdc90
23071 changed files with 4933189 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
<?php
/**
* Hides notifications
*
* Github: https://github.com/alexkovalevv
*
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
* @copyright (c) 2018 Webraftic Ltd
* @version 1.0
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
function wbcr_dan_ajax_hide_notices() {
check_ajax_referer( WDN_Plugin::app()->getPluginName() . '_ajax_hide_notices_nonce', 'security' );
if ( current_user_can( 'manage_options' ) || current_user_can( 'manage_network' ) ) {
$notice_id = WDN_Plugin::app()->request->post( 'notice_id', null, true );
$notice_html = WDN_Plugin::app()->request->post( 'notice_html', null );
$hide_target = WDN_Plugin::app()->request->post( 'target', 'user' );
//$notice_text = wp_kses( $notice_html, [] );
if ( empty( $notice_id ) ) {
wp_send_json_error( [ 'error_message' => __( 'Undefinded notice id.', 'disable-admin-notices' ) ] );
}
switch ( $hide_target ) {
case 'all':
$get_hidden_notices = WDN_Plugin::app()->getPopulateOption( 'hidden_notices', [] );
if ( ! is_array( $get_hidden_notices ) ) {
$get_hidden_notices = [];
}
$get_hidden_notices[ $notice_id ] = rtrim( trim( $notice_html ) );
WDN_Plugin::app()->updatePopulateOption('hidden_notices', $get_hidden_notices );
break;
case 'user':
default:
$current_user_id = get_current_user_id();
$get_hidden_notices = get_user_meta( $current_user_id, WDN_Plugin::app()->getOptionName( 'hidden_notices' ), true );
if ( ! is_array( $get_hidden_notices ) ) {
$get_hidden_notices = [];
}
$get_hidden_notices[ $notice_id ] = rtrim( trim( $notice_html ) );
update_user_meta( $current_user_id, WDN_Plugin::app()->getOptionName( 'hidden_notices' ), $get_hidden_notices );
break;
}
wp_send_json_success();
} else {
wp_send_json_error( [ 'error_message' => __( 'You don\'t have enough capability to edit this information.', 'disable-admin-notices' ) ] );
}
}
add_action( 'wp_ajax_wbcr-dan-hide-notices', 'wbcr_dan_ajax_hide_notices' );

View File

@@ -0,0 +1,49 @@
<?php
/**
* Restore notice
*
* Github: https://github.com/alexkovalevv
*
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
* @copyright (c) 2018 Webraftic Ltd
* @version 1.0
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
function wbcr_dan_ajax_restore_notice() {
check_ajax_referer( WDN_Plugin::app()->getPluginName() . '_ajax_restore_notice_nonce', 'security' );
if ( current_user_can( 'manage_options' ) || current_user_can( 'manage_network' ) ) {
$notice_id = WDN_Plugin::app()->request->post( 'notice_id', null, true );
if ( empty( $notice_id ) ) {
wp_send_json_error( [ 'error_message' => __( 'Undefinded notice id.', 'disable-admin-notices' ) ] );
}
//Users notices
$current_user_id = get_current_user_id();
$get_hidden_notices = get_user_meta( $current_user_id, WDN_Plugin::app()->getOptionName( 'hidden_notices' ), true );
if ( ! empty( $get_hidden_notices ) && isset( $get_hidden_notices[ $notice_id ] ) ) {
unset( $get_hidden_notices[ $notice_id ] );
update_user_meta( $current_user_id, WDN_Plugin::app()->getOptionName( 'hidden_notices' ), $get_hidden_notices );
}
//All notices
$get_hidden_notices_all = WDN_Plugin::app()->getPopulateOption( 'hidden_notices', [] );
if ( ! empty( $get_hidden_notices_all ) && isset( $get_hidden_notices_all[ $notice_id ] ) ) {
unset( $get_hidden_notices_all[ $notice_id ] );
WDN_Plugin::app()->updatePopulateOption( 'hidden_notices', $get_hidden_notices_all );
}
wp_send_json_success();
} else {
wp_send_json_error( [ 'error_message' => __( 'You don\'t have enough capability to edit this information.', 'disable-admin-notices' ) ] );
}
}
add_action( 'wp_ajax_wbcr-dan-restore-notice', 'wbcr_dan_ajax_restore_notice' );

View File

@@ -0,0 +1,51 @@
.wbcr-dan-hide-notices {
position: initial;
padding: 5px 5px 0;
background: transparent;
}
.wbcr-dan-hide-notices > div {
margin: 0 !important;
}
.is-dismissible .wbcr-dan-hide-links {
margin-right: -25px;
}
.wbcr-dan-hide-links {
text-align: right;
padding: 0 5px 5px 0;
}
.wbcr-dan-hide-links .wbcr-dan-hide-notice-link {
min-height: 20px;
line-height: 2;
padding: 0 5px 0 0;
font-size: 11px;
color: #ec3c47;
background: #fff;
margin: 0;
cursor: pointer;
border: 1px solid #ec3c47;
border-radius: 5px;
}
.wbcr-dan-hide-links .wbcr-dan-hide-notice-link:hover {
background: #ec3c47;
color: #fff;
}
.wbcr-dan-hide-links .wbcr-dan-hide-notice-link:hover:before {
background-image: url('../img/hide-icon-white.svg');
}
.wbcr-dan-hide-links .wbcr-dan-hide-notice-link:focus {
border: 2px solid #ec3c47;
outline: none;
}
.wbcr-dan-hide-links .wbcr-dan-hide-notice-link:before {
content: '';
display: inline-block;
width: 25px;
height: 18px;
background-color: transparent;
background-image: url('../img/hide-icon.svg');
background-repeat: no-repeat;
background-position: center center;
background-size: 25px;
vertical-align: middle;
}
/*# sourceMappingURL=general.css.map */

View File

@@ -0,0 +1,77 @@
/**
* Notification panel in admin bar
* @author Alex Kovalev <alex.kovalevv@gmail.com>
* @copyright Alex Kovalev 23.08.2017
*/
#wp-admin-bar-wbcr-han-notify-panel .wbcr-han-adminbar-counter {
background-color: #0073aa;
border-radius: 50%;
color: #fff;
font-weight: bold;
padding: 2px 6px;
font-size: 0.85em;
margin-left: 5px;
}
#wp-admin-bar-wbcr-han-notify-panel .ab-sub-wrapper {
max-height: 500px;
overflow-y: scroll;
}
#wp-admin-bar-wbcr-han-notify-panel .ab-sub-wrapper ul.ab-submenu {
width: 400px;
padding: 0;
}
#wp-admin-bar-wbcr-han-notify-panel .ab-sub-wrapper ul.ab-submenu > li {
border-left: 4px solid #26292b;
padding: 0;
}
#wp-admin-bar-wbcr-han-notify-panel .ab-sub-wrapper ul.ab-submenu > li.wpnc-updated {
border-left-color: #7ad03a;
}
#wp-admin-bar-wbcr-han-notify-panel .ab-sub-wrapper ul.ab-submenu > li.wpnc-update-nag {
border-left-color: #ffba00;
}
#wp-admin-bar-wbcr-han-notify-panel .ab-sub-wrapper ul.ab-submenu > li.wpnc-error {
border-left-color: #dd3d36;
}
#wp-admin-bar-wbcr-han-notify-panel .ab-sub-wrapper ul.ab-submenu > li .wbcr-han-panel-restore-notify-line {
text-align: right;
}
#wp-admin-bar-wbcr-han-notify-panel .ab-sub-wrapper ul.ab-submenu > li .wbcr-han-panel-restore-notify-line a {
color: #ffba00 !important;
text-decoration: none !important;
}
#wp-admin-bar-wbcr-han-notify-panel .ab-sub-wrapper ul.ab-submenu > li .wbcr-han-panel-restore-notify-line a:hover {
text-decoration: underline !important;
color: #ffc11a !important;
}
#wp-admin-bar-wbcr-han-notify-panel .ab-sub-wrapper ul.ab-submenu > li .ab-item {
height: 100% !important;
white-space: normal !important;
padding: 0.5em 1em;
border-bottom: 1px solid #4a4f55;
color: #949494;
line-height: 1.5 !important;
}
#wp-admin-bar-wbcr-han-notify-panel .ab-sub-wrapper ul.ab-submenu > li .ab-item a {
display: inline;
padding: 0;
margin: 0;
text-decoration: underline;
line-height: 1.5 !important;
color: #949494;
}
#wp-admin-bar-wbcr-han-notify-panel .ab-sub-wrapper ul.ab-submenu > li[id^=wp-admin-bar-wbcr-han-notify-panel-group] .ab-item {
height: 100%;
white-space: normal;
padding: 0.5em 1em;
border-bottom: 1px solid #fff;
color: #fff;
line-height: 2;
text-align: center;
font-weight: bold;
text-transform: uppercase;
}
#wp-admin-bar-wbcr-han-notify-panel .ab-sub-wrapper ul.ab-submenu li:nth-child(2n) {
background: #26292b;
}
/*# sourceMappingURL=notifications-panel.css.map */

View File

@@ -0,0 +1,9 @@
.wdan-plugin-header-logo {
background: transparent url('../img/hide-icon.svg') no-repeat left center !important;
background-size: 40px !important;
display: block;
float: left;
height: 30px;
width: 40px;
}
/*# sourceMappingURL=page.css.map */

View File

@@ -0,0 +1,220 @@
#WBCR .factory-checkbox.wdanpro-checkbox-premium-label:after,
#WBCR .wdanpro-radio-premium-label .factory-compact_panel:after {
display: inline-block;
position: relative;
content: 'PRO';
background: #ff5722;
border-radius: 4px;
color: #fff;
font-size: 10px;
line-height: 1;
font-style: normal;
padding: 4px 6px;
margin-left: 4px;
vertical-align: top;
top: -8px;
left: -10px;
right: auto;
z-index: 11;
cursor: pointer;
}
#WBCR .wdanpro-radio-premium-label .factory-compact_panel:after {
position: absolute;
top: -10px;
right: -10px;
left: auto;
}
#WBCR .factory-checkbox-disabled input,
#WBCR .factory-checkbox-disabled button,
#WBCR .wdanpro-radio-premium-label .factory-compact_panel {
pointer-events: none;
cursor: not-allowed;
opacity: 0.65;
filter: alpha(opacity=65);
-webkit-box-shadow: none;
box-shadow: none;
}
#WBCR .wrdan-premium-fake-content {
position: relative;
padding: 15px;
}
#WBCR .wdan-premium-info {
position: absolute;
top: 50px;
left: 50%;
margin-left: -250px;
max-width: 500px;
z-index: 999;
}
#WBCR .wdan-premium-info h3 {
font-size: 32px;
font-weight: 300;
color: inherit;
margin: 40px 0 10px;
line-height: 1.2;
}
#WBCR .wdan-premium-info p {
font-size: 16px;
font-weight: 400;
color: #a4afb7;
margin-bottom: 40px;
}
#WBCR .wdan-premium-layer {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
opacity: 0.9;
background: #fff;
}
#WBCR .wdan-button {
font-family: Roboto, Arial, Helvetica, Verdana, sans-serif;
font-weight: 500;
text-transform: uppercase;
outline: none;
border: none;
text-decoration: none;
-webkit-border-radius: 3px;
border-radius: 3px;
-webkit-transition-property: background, color, opacity, -webkit-box-shadow;
transition-property: background, color, opacity, -webkit-box-shadow;
-o-transition-property: background, color, box-shadow, opacity;
transition-property: background, color, box-shadow, opacity;
transition-property: background, color, box-shadow, opacity, -webkit-box-shadow;
-webkit-transition-duration: 0.3s;
-o-transition-duration: 0.3s;
transition-duration: 0.3s;
}
#WBCR .wdan-button:hover {
border: none;
}
#WBCR .wdan-button:not([disabled]) {
cursor: pointer;
}
#WBCR .wdan-button:not(.wdan-button-state) .wdan-state-icon {
display: none;
}
#WBCR .wdan-button.wdan-button-success {
color: #fff;
}
#WBCR .wdan-button.wdan-button-success[disabled] {
background-color: #c2cbd2;
}
#WBCR .wdan-button.wdan-button-success:not([disabled]) {
background-color: #39b54a;
}
#WBCR .wdan-button.wdan-button-success:not([disabled]):hover {
opacity: 0.85;
-webkit-box-shadow: 0 0 2px rgba(0, 0, 0, 0.12), 0 2px 2px rgba(0, 0, 0, 0.2);
box-shadow: 0 0 2px rgba(0, 0, 0, 0.12), 0 2px 2px rgba(0, 0, 0, 0.2);
}
#WBCR .wdan-button.wdan-button-success:not([disabled]):active {
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.19), 0 3px 3px rgba(0, 0, 0, 0.1);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.19), 0 3px 3px rgba(0, 0, 0, 0.1);
}
#WBCR .wdan-button.wdan-button-warning {
background-color: #a4afb7;
color: #fff;
}
#WBCR .wdan-button.wdan-button-warning[disabled] {
background-color: #c2cbd2;
}
#WBCR .wdan-button.wdan-button-warning:not([disabled]):hover {
background-color: #b01b1b;
opacity: 0.85;
-webkit-box-shadow: 0 0 2px rgba(0, 0, 0, 0.12), 0 2px 2px rgba(0, 0, 0, 0.2);
box-shadow: 0 0 2px rgba(0, 0, 0, 0.12), 0 2px 2px rgba(0, 0, 0, 0.2);
}
#WBCR .wdan-button.wdan-button-warning:not([disabled]):active {
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.19), 0 3px 3px rgba(0, 0, 0, 0.1);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.19), 0 3px 3px rgba(0, 0, 0, 0.1);
}
#WBCR .wdan-button.wdan-button-danger {
background-color: #d72b3f;
color: #fff;
}
#WBCR .wdan-button.wdan-button-danger[disabled] {
background-color: #c2cbd2;
}
#WBCR .wdan-button.wdan-button-danger:not([disabled]):hover {
opacity: 0.85;
-webkit-box-shadow: 0 0 2px rgba(0, 0, 0, 0.12), 0 2px 2px rgba(0, 0, 0, 0.2);
box-shadow: 0 0 2px rgba(0, 0, 0, 0.12), 0 2px 2px rgba(0, 0, 0, 0.2);
}
#WBCR .wdan-button.wdan-button-danger:not([disabled]):active {
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.19), 0 3px 3px rgba(0, 0, 0, 0.1);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.19), 0 3px 3px rgba(0, 0, 0, 0.1);
}
#WBCR .wdan-button.wdan-edit-template {
display: inline-block;
margin-top: 15px;
color: #fff;
}
#WBCR .wdan-button.wdan-button-default {
background-color: #a4afb7;
color: #fff;
font-size: 11px;
padding: 7px 21px;
}
#WBCR .wdan-button.wdan-button-default:hover {
background-color: #6d7882;
-webkit-box-shadow: 0 0 2px rgba(0, 0, 0, 0.12), 0 2px 2px rgba(0, 0, 0, 0.2);
box-shadow: 0 0 2px rgba(0, 0, 0, 0.12), 0 2px 2px rgba(0, 0, 0, 0.2);
}
#WBCR .wdan-button.wdan-button-default:active {
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.19), 0 3px 3px rgba(0, 0, 0, 0.1);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.19), 0 3px 3px rgba(0, 0, 0, 0.1);
}
#WBCR .wdan-button.wdan-button-default:visited {
color: #fff;
}
#WBCR .wdan-button.wdan-button-go-pro {
background-color: #ff5722;
}
#WBCR .wdan-button i {
margin-right: 10px;
}
.wdan-hidden-list {
padding: 0 15px;
}
.wdan-hidden-list-notice {
background: #fff;
border: 1px solid #ccd0d4;
border-left-width: 4px;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
padding: 1px 12px;
}
.wdan-hidden-list-notice div.wdan-notice-p {
margin: 0.5em 0;
padding: 2px;
}
.wdan-hidden-list-notice div.wdan-notice-p div {
width: 100%;
}
.wdan-hidden-list-table {
border: 0;
}
.wdan-hidden-list-table tr > td:first-child {
padding: 5px 0 5px;
}
.wdan-hidden-list-table tr > td:last-child {
padding: 0 10px 0;
text-align: center;
}
.wdan-hidden-list-table .wdan-notices-page-table-head td {
font-size: 16px;
text-transform: uppercase;
padding: 10px !important;
font-weight: bold;
}
.wdan-hidden-list-table .wdan-hidden-list-notice-action {
vertical-align: middle;
}
.wdan-hidden-list-table .wdan-page-restore-notice-link-loader {
background: url(../img/loader.gif);
background-size: contain;
background-repeat: no-repeat;
background-position: top;
}
/*# sourceMappingURL=settings.css.map */

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="300.000000pt" height="234.000000pt" viewBox="0 0 300.000000 234.000000"
preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,234.000000) scale(0.100000,-0.100000)"
fill="#ffffff" stroke="none">
<path d="M629 2072 c-15 -13 -22 -30 -22 -51 0 -29 20 -53 177 -210 l176 -177
-92 -95 c-99 -101 -201 -236 -244 -324 l-26 -54 21 -44 c85 -174 274 -388 446
-502 159 -106 295 -149 475 -148 141 1 236 24 365 87 l90 45 186 -185 c158
-157 190 -184 215 -184 39 0 74 36 74 76 0 25 -114 142 -878 906 -789 790
-880 878 -908 878 -18 0 -42 -8 -55 -18z m544 -650 l98 -98 -23 -50 c-31 -68
-30 -170 1 -242 31 -68 113 -144 182 -167 64 -22 177 -16 232 11 l38 18 89
-89 c50 -49 90 -92 90 -96 0 -9 -105 -55 -175 -75 -82 -25 -258 -25 -339 0
-124 37 -255 116 -364 220 -87 81 -232 273 -232 306 0 43 260 360 296 360 5 0
53 -44 107 -98z m314 -314 c51 -51 93 -96 93 -99 0 -13 -53 -17 -89 -7 -44 12
-89 52 -107 95 -21 48 -18 103 5 103 3 0 47 -42 98 -92z"/>
<path d="M1410 1849 c-87 -15 -123 -52 -105 -109 13 -40 47 -53 111 -41 226
42 459 -41 660 -235 69 -67 171 -194 210 -260 l26 -45 -37 -57 c-21 -31 -56
-81 -78 -110 -47 -62 -53 -105 -18 -134 27 -21 70 -24 92 -5 55 44 199 267
199 307 0 14 -16 53 -36 85 -263 437 -650 665 -1024 604z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="300.000000pt" height="234.000000pt" viewBox="0 0 300.000000 234.000000"
preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,234.000000) scale(0.100000,-0.100000)"
fill="#ed3c48" stroke="none">
<path d="M629 2072 c-15 -13 -22 -30 -22 -51 0 -29 20 -53 177 -210 l176 -177
-92 -95 c-99 -101 -201 -236 -244 -324 l-26 -54 21 -44 c85 -174 274 -388 446
-502 159 -106 295 -149 475 -148 141 1 236 24 365 87 l90 45 186 -185 c158
-157 190 -184 215 -184 39 0 74 36 74 76 0 25 -114 142 -878 906 -789 790
-880 878 -908 878 -18 0 -42 -8 -55 -18z m544 -650 l98 -98 -23 -50 c-31 -68
-30 -170 1 -242 31 -68 113 -144 182 -167 64 -22 177 -16 232 11 l38 18 89
-89 c50 -49 90 -92 90 -96 0 -9 -105 -55 -175 -75 -82 -25 -258 -25 -339 0
-124 37 -255 116 -364 220 -87 81 -232 273 -232 306 0 43 260 360 296 360 5 0
53 -44 107 -98z m314 -314 c51 -51 93 -96 93 -99 0 -13 -53 -17 -89 -7 -44 12
-89 52 -107 95 -21 48 -18 103 5 103 3 0 47 -42 98 -92z"/>
<path d="M1410 1849 c-87 -15 -123 -52 -105 -109 13 -40 47 -53 111 -41 226
42 459 -41 660 -235 69 -67 171 -194 210 -260 l26 -45 -37 -57 c-21 -31 -56
-81 -78 -110 -47 -62 -53 -105 -18 -134 27 -21 70 -24 92 -5 55 44 199 267
199 307 0 14 -16 53 -36 85 -263 437 -650 665 -1024 604z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

@@ -0,0 +1,59 @@
/**
* Notification panel
* @author Webcraftic <wordpress.webraftic@gmail.com>
* @copyright (c) 10.09.2017, Webcraftic
* @version 1.0
*/
(function($) {
'use strict';
$(document).ready(function() {
$(document).on('click', '.wbcr-han-panel-restore-notify-link', function() {
var self = $(this),
noticeID = $(this).data('notice-id'),
nonce = $(this).data('nonce'),
counterEl = $('.wbcr-han-adminbar-counter');
if( !noticeID ) {
alert('Undefinded error. Please report the bug to our support forum.');
}
self.closest('li').hide();
$.ajax(ajaxurl, {
type: 'post',
dataType: 'json',
data: {
action: 'wbcr-dan-restore-notice',
security: nonce,
notice_id: noticeID
},
success: function(response) {
if( !response || !response.success ) {
if( response.data.error_message ) {
console.log(response.data.error_message);
self.closest('li').show();
} else {
console.log(response);
}
return;
}
counterEl.text(counterEl.text() - 1);
self.closest('li').remove();
},
error: function(xhr, ajaxOptions, thrownError) {
console.log(xhr.status);
console.log(xhr.responseText);
console.log(thrownError);
}
});
return false;
});
});
})(jQuery);

View File

@@ -0,0 +1,69 @@
/**
* General
* @author Webcraftic <wordpress.webraftic@gmail.com>
* @copyright (c) 2020, Webcraftic
* @version 1.0
*/
(function ($) {
function dan_pro_href(e) {
var pro_href = "https://clearfy.pro/disable-admin-notices/";
e.stopPropagation();
window.open(pro_href, '_blank');
}
$('.factory-checkbox.wdanpro-checkbox-premium-label').click(dan_pro_href);
$('.wdanpro-radio-premium-label .factory-compact_panel').click(dan_pro_href);
$(document).on('click', '.wdan-page-restore-notice-link', function () {
var self = $(this),
noticeID = $(this).data('notice-id'),
nonce = $(this).data('nonce'),
counterEl = $('.wbcr-han-adminbar-counter');
if (!noticeID) {
alert('Undefinded error. Please report the bug to our support forum.');
}
self.hide();
self.parent().find('.wdan-page-restore-notice-link-loader').show();
$.ajax(ajaxurl, {
type: 'post',
dataType: 'json',
data: {
action: 'wbcr-dan-restore-notice',
security: nonce,
notice_id: noticeID
},
success: function (response) {
if (!response || !response.success) {
if (response.data.error_message) {
console.log(response.data.error_message);
self.closest('li').show();
} else {
console.log(response);
}
return;
}
counterEl.text(counterEl.text() - 1);
self.closest('tr').hide();
self.closest('tr').remove();
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.status);
console.log(xhr.responseText);
console.log(thrownError);
}
});
return false;
});
})(jQuery);

View File

@@ -0,0 +1,116 @@
<?php
/**
* Файл использует для реализации коротких сниппетов. Обычно сниппеты относятся к интеграции
* или каким мелким исправлениям и фиксам в интерфейсе этого плагина.
*
* Github: https://github.com/alexkovalevv
*
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
* @copyright (c) 2018 Webraftic Ltd
* @version 1.0
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! defined( 'LOADING_DISABLE_ADMIN_NOTICES_AS_ADDON' ) ) {
add_filter( 'plugin_row_meta', function ( $links, $file ) {
if ( $file == WDN_PLUGIN_BASE ) {
$url = 'https://clearfy.pro/disable-admin-notices/';
$url .= '?utm_source=wordpress.org&utm_campaign=' . WDN_Plugin::app()->getPluginName();
$links[] = '<a href="' . $url . '" style="color: #FF5722;font-weight: bold;" target="_blank">' . __( 'Get premium plugin', 'disable-admin-notices' ) . '</a>';
}
return $links;
}, 10, 2 );
/**
* Изменяем ссылку по умолчанию на собственную в виджете "Голосу за нас".
*
* Ссылка ведет на страницу рейтинга в репозитории Wordpress.org
* https://wordpress.org/support/plugin/disable-admin-notices/reviews/
*
* @param string $page_url
* @param string $plugin_name
*
* @return string
* @since 1.0
*
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
*/
add_filter( 'wbcr_factory_pages_480_imppage_rating_widget_url', function ( $page_url, $plugin_name ) {
if ( $plugin_name == WDN_Plugin::app()->getPluginName() ) {
return 'https://goo.gl/68ucHp';
}
return $page_url;
}, 10, 2 );
/**
* Удаляем лишние виджеты из правого сайдбара в интерфейсе плагина
*
* - Виджет с премиум рекламой
* - Виджет с рейтингом
* - Виджет с маркерами информации
*/
add_filter( 'wbcr/factory/pages/impressive/widgets', function ( $widgets, $position, $plugin ) {
if ( WDN_Plugin::app()->getPluginName() == $plugin->getPluginName() && 'right' == $position ) {
unset( $widgets['business_suggetion'] );
unset( $widgets['rating_widget'] );
unset( $widgets['info_widget'] );
}
return $widgets;
}, 20, 3 );
} else {
/**
* Регистрируем опции плагина в Clearfy, чтобы тот мог совершать манипуляции с опциями этого плагина.
* Обычно такие манипуляции относятся к быстрым настройкам, сбросу настроек.
*
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
* @since 1.0
*/
add_filter( "wbcr_clearfy_group_options", function ( $options ) {
$options[] = [
'name' => 'hide_admin_notices',
'title' => __( 'Hide admin notices', 'disable-admin-notices' ),
'tags' => [],
'values' => [ 'hide_admin_notices' => 'only_selected' ]
];
$options[] = [
'name' => 'show_notices_in_adminbar',
'title' => __( 'Enable hidden notices in adminbar', 'disable-admin-notices' ),
'tags' => []
];
return $options;
} );
}
/**
* Print admin notice: "Would you like to send them for spam checking?"
*
* If user clicked button "Yes, do it", plugin will exec action,
* that put all unapproved comments to spam check queue.
*/
add_action( 'wbcr/factory/admin_notices', function ( $notices, $plugin_name ) {
if ( $plugin_name != WDN_Plugin::app()->getPluginName() || 'wbcr_clearfy' === $plugin_name ) {
return $notices;
}
$page_url = 'https://clearfy.pro/disable-admin-notices/';
$notice_text = sprintf( __( 'Thanks for using the Disable admin notices plugin! If you need support or all the features of the plugin, please buy the pro version <a class="button" href="%s">Get PRO</a>' ), $page_url );
$notices[] = [
'id' => 'wdan_get_premium',
'type' => 'success',
'dismissible' => true,
'dismiss_expires' => 0,
'text' => '<p><strong>Disable Admin Notices Individually:</strong><br>' . $notice_text . '</p>'
];
return $notices;
}, 10, 2 );

View File

@@ -0,0 +1,43 @@
<?php
/**
* Страница общих настроек для этого плагина.
*
* Может быть использована только, если этот плагин используется как отдельный плагин, а не как аддон
* дя плагина Clearfy. Если плагин загружен, как аддон для Clearfy, эта страница не будет подключена.
*
* Поддерживает режим работы с мультисаймами. Вы можете увидеть эту страницу в панели настройки сети.
*
* Github: https://github.com/alexkovalevv
*
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
* @copyright (c) 2018 Webraftic Ltd
* @version 1.0
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
class WDN_Page extends WBCR\Factory_Templates_134\Pages\PageBase {
/**
* Requests assets (js and css) for the page.
*
* @param Wbcr_Factory480_ScriptList $scripts
* @param Wbcr_Factory480_StyleList $styles
*
* @return void
* @see Wbcr_FactoryPages480_AdminPage
*
*/
public function assets( $scripts, $styles ) {
$this->styles->add( WDN_PLUGIN_URL . '/admin/assets/css/page.css' );
parent::assets( $scripts, $styles );
}
public function getPluginTitle() {
return "<span class='wdan-plugin-header-logo'>&nbsp;</span>" . __( 'Webcraftic Disable Admin Notices', 'disable-admin-notices' );
}
}

View File

@@ -0,0 +1,269 @@
<?php
/**
* Регистрируем поля Html формы в Clearfy на странице "Подолнительно". Если этот плагин загружен, как отдельный плагин
* то поля будет зарегистрированы для страницы общих настроек этого плагина.
*
* Github: https://github.com/alexkovalevv
*
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
* @copyright (c) 2018 Webraftic Ltd
* @version 1.0
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Регистрируем поля Html формы с настройками плагина.
*
* Эта функция используется для общей страницы настроек текущего плагина,
* а также для раширения настроек в плагине Clearfy.
*
* @return array Возвращает группу зарегистрируемых опций
* @since 1.0
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
*/
function wbcr_dan_get_plugin_options() {
$options = [];
$options[] = [
'type' => 'html',
'html' => '<div class="wbcr-factory-page-group-header">' . '<strong>' . __( 'Admin notifications, Update nags', 'disable-admin-notices' ) . '</strong>' . '<p>' . __( 'Do you know the situation, when some plugin offers you to update to premium, to collect technical data and shows many annoying notices? You are close these notices every now and again but they newly appears and interfere your work with WordPress. Even worse, some plugins authors delete “close” button from notices and they shows in your admin panel forever.', 'disable-admin-notices' ) . '</p>' . '</div>'
];
$hide_admin_notices_data = [
[
'not_hide',
__( "Don't hide", 'disable-admin-notices' ),
__( 'Do not hide notices and do not show “Hide notification forever” link for admin.', 'disable-admin-notices' )
],
[
'all',
__( 'All notices', 'disable-admin-notices' ),
__( 'Hide all notices globally.', 'disable-admin-notices' ) . sprintf( __( 'Watch the <a href="%s" target="_blank">video</a> to find out how it works .', 'disable-admin-notices' ), 'https://youtu.be/_Lv5i4P3Gqs' )
],
[
'only_selected',
__( 'Only selected', 'disable-admin-notices' ),
__( 'Hide selected notices only. You will see the link "Hide notification forever" in each notice. Push it and they will not bother you anymore.', 'disable-admin-notices' ) . sprintf( __( 'Watch the <a href="%s" target="_blank">video</a> to find out how it works .', 'disable-admin-notices' ), 'https://youtu.be/HazI81AsHuY' )
]
];
if ( ! wbcr_dan_is_active_clearfy_component() ) {
$hide_admin_notices_data[] = [
'compact_panel',
__( 'Compact panel', 'disable-admin-notices' ),
__( 'Collapse all notifications in one line (panel with notification counters), to see the notifications, you will need to click this panel.', 'disable-admin-notices' ) . sprintf( __( 'Watch the <a href="%s" target="_blank">video</a> to find out how it works .', 'disable-admin-notices' ), 'https://youtu.be/437u1Js2o2M' )
];
}
$options[] = [
'type' => 'dropdown',
'name' => 'hide_admin_notices',
'way' => 'buttons',
'title' => __( 'Hide admin notices', 'disable-admin-notices' ),
'data' => $hide_admin_notices_data,
'layout' => [ 'hint-type' => 'icon', 'hint-icon-color' => 'green' ],
'hint' => __( 'Some plugins shows notifications about premium version, data collecting or promote their services. Even if you push close button (that sometimes are impossible), notices are shows again in some time. This option allows you to control notices. Hide them all or each individually. Some plugins shows notifications about premium version, data collecting or promote their services. Even if you push close button (that sometimes are impossible), notices are shows again in some time. This option allows you to control notices. Hide them all or each individually.', 'disable-admin-notices' ),
'default' => 'only_selected',
'cssClass' => ! ( WDN_Plugin::app()->premium->is_activate() && WDN_Plugin::app()->premium->is_install_package() ) ? [ 'wdanpro-radio-premium-label' ] : [],
'events' => [
'all' => [
'show' => '.factory-control-hide_admin_notices_user_roles',
'hide' => '.factory-control-reset_notices_button'
],
'only_selected' => [
'hide' => '.factory-control-hide_admin_notices_user_roles',
'show' => '.factory-control-reset_notices_button'
],
'not_hide' => [
'hide' => '.factory-control-hide_admin_notices_user_roles, .factory-control-reset_notices_button'
]
]
];
if ( ! wbcr_dan_is_active_clearfy_component() ) {
$options[] = [
'type' => 'checkbox',
'way' => 'buttons',
'name' => 'disable_updates_nags_for_plugins',
'title' => __( 'Disable plugins updates nags', 'disable-admin-notices' ),
'layout' => [ 'hint-type' => 'icon', 'hint-icon-color' => 'grey' ],
'hint' => __( 'Disable plugins updates nags', 'disable-admin-notices' ),
'cssClass' => ! ( WDN_Plugin::app()->premium->is_activate() && WDN_Plugin::app()->premium->is_install_package() ) ? [ 'factory-checkbox-disabled wdanpro-checkbox-premium-label' ] : [],
'default' => false
];
$options[] = [
'type' => 'checkbox',
'way' => 'buttons',
'name' => 'disable_updates_nags_for_core',
'title' => __( 'Disable core updates nags', 'disable-admin-notices' ),
'layout' => [ 'hint-type' => 'icon', 'hint-icon-color' => 'grey' ],
'hint' => __( 'Disable core updates nags', 'disable-admin-notices' ),
'cssClass' => ! ( WDN_Plugin::app()->premium->is_activate() && WDN_Plugin::app()->premium->is_install_package() ) ? [ 'factory-checkbox-disabled wdanpro-checkbox-premium-label' ] : [],
'default' => false
];
}
/*$options[] = array(
'type' => 'dropdown',
'name' => 'hide_admin_notices_for',
'way' => 'buttons',
'title' => __('Hide admin notices only for', 'disable-admin-notices'),
'data' => array(
array(
'user',
__('Current user', 'disable-admin-notices')
),
array(
'all_users',
__('All users', 'disable-admin-notices')
)
),
'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'green'),
'hint' => __('Choose who to hide notifications for?', 'disable-admin-notices'),
'default' => 'user',
'events' => array(
'all' => array(
'show' => '.factory-control-hide_admin_notices_user_roles',
'hide' => '.factory-control-reset_notices_button'
),
'only_selected' => array(
'hide' => '.factory-control-hide_admin_notices_user_roles',
'show' => '.factory-control-reset_notices_button'
),
'not_hide' => array(
'hide' => '.factory-control-hide_admin_notices_user_roles, .factory-control-reset_notices_button'
)
)
);*/
$options[] = [
'type' => 'checkbox',
'way' => 'buttons',
'name' => 'show_notices_in_adminbar',
'title' => __( 'Enable hidden notices in adminbar', 'disable-admin-notices' ),
'layout' => [ 'hint-type' => 'icon', 'hint-icon-color' => 'green' ],
'hint' => __( 'By default, the plugin hides all notices, which you specified. If you enable this option, the plugin will collect all hidden notices and show them into the top admin toolbar. It will not disturb you but will allow to look notices at your convenience.', 'disable-admin-notices' ),
'default' => false
];
$options[] = [
'type' => 'html',
'html' => 'wbcr_dan_reset_notices_button'
];
return $options;
}
function wbcr_dan_is_active_clearfy_component() {
if ( defined( 'WCL_PLUGIN_ACTIVE' ) && class_exists( 'WCL_Plugin' ) ) {
$deactivate_components = WCL_Plugin::app()->getPopulateOption( 'deactive_preinstall_components', [] );
if ( ! in_array( 'disable_notices', $deactivate_components ) ) {
return true;
}
}
return false;
}
/**
* Расширяем опции html формы страницы "Дополнительно" в плагине Clearfy
*
* Это необходимо для того, чтобы не создавать отдельную страницу в плагине Clearfy, \
* с настройками этого плагина, потому что это ухудшает юзабилити.
*
* @param array $form Массив с группой настроек, страницы "Дополнительно" в плагине Clearfy
* @param Wbcr_FactoryPages480_ImpressiveThemplate $page Экземпляр страницы
*
* @return mixed Отсортированный массив с группой опций
*/
function wbcr_dan_additionally_form_options( $form, $page ) {
if ( empty( $form ) ) {
return $form;
}
$options = wbcr_dan_get_plugin_options();
foreach ( array_reverse( $options ) as $option ) {
array_unshift( $form[0]['items'], $option );
}
return $form;
}
add_filter( 'wbcr_clr_additionally_form_options', 'wbcr_dan_additionally_form_options', 10, 2 );
/**
* Реализует кнопку сброса скрытых уведомлений.
*
* Вы можете выбрать для какой группы пользователей сбросить уведомления.
* Эта модикация является не стандартной, поэтому мы не можете реалировать ее
* через фреймворк.
*
* @param @param $html_builder Wbcr_FactoryForms480_Html
*
* @since 1.0
*
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
*/
function wbcr_dan_reset_notices_button( $html_builder ) {
global $wpdb;
$form_name = $html_builder->getFormName();
$reseted = false;
if ( isset( $_POST['wbcr_dan_reset_action'] ) ) {
check_admin_referer( $form_name, 'wbcr_dan_reset_nonce' );
$reset_for_users = WDN_Plugin::app()->request->post( 'wbcr_dan_reset_for_users', 'current_user', true );
if ( $reset_for_users == 'current_user' ) {
delete_user_meta( get_current_user_id(), WDN_Plugin::app()->getOptionName( 'hidden_notices' ) );
} else {
$meta_key = sanitize_key( WDN_Plugin::app()->getOptionName( 'hidden_notices' ) );
$wpdb->query( "DELETE FROM {$wpdb->usermeta} WHERE meta_key = '{$meta_key}'" );
}
$reseted = true;
}
?>
<div class="form-group form-group-checkbox factory-control-reset_notices_button">
<label for="wbcr_clearfy_reset_notices_button" class="col-sm-4 control-label">
<?= __( 'Reset hidden notices for', 'disable-admin-notices' ); ?>
<span class="factory-hint-icon factory-hint-icon-grey" data-toggle="factory-tooltip" data-placement="right"
title=""
data-original-title="<?php _e( 'Push reset hidden notices if you need to show hidden notices again.', 'disable-admin-notices' ) ?>">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAQAAABKmM6bAAAAUUlEQVQIHU3BsQ1AQABA0X/komIrnQHYwyhqQ1hBo9KZRKL9CBfeAwy2ri42JA4mPQ9rJ6OVt0BisFM3Po7qbEliru7m/FkY+TN64ZVxEzh4ndrMN7+Z+jXCAAAAAElFTkSuQmCC"
alt="">
</span>
</label>
<div class="control-group col-sm-8">
<div class="factory-checkbox factory-from-control-checkbox factory-buttons-way btn-group">
<form method="post">
<?php wp_nonce_field( $form_name, 'wbcr_dan_reset_nonce' ); ?>
<p>
<input type="radio" name="wbcr_dan_reset_for_users" value="current_user"
checked/> <?= __( 'current user', 'disable-admin-notices' ); ?>
</p>
<p>
<input type="radio" name="wbcr_dan_reset_for_users"
value="all"/> <?= __( 'all users', 'disable-admin-notices' ); ?>
</p>
<p>
<input type="submit" name="wbcr_dan_reset_action"
value="<?= __( 'Reset notices', 'disable-admin-notices' ); ?>"
class="button button-default"/>
</p>
<?php if ( $reseted ): ?>
<div style="color:green;margin-top:5px;"><?php _e( 'Hidden notices are successfully reset, now you can see them again!', 'disable-admin-notices' ) ?></div>
<?php endif; ?>
</form>
</div>
</div>
</div>
<?php
}

View File

@@ -0,0 +1,147 @@
<?php
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Страница общих настроек для этого плагина.
*
* Не поддерживает режим работы с мультисаймами.
*
* @author Alexander Kovalev <alex.kovalevv@gmail.com>, Github: https://github.com/alexkovalevv
* @copyright (c) 2019 Webraftic Ltd
* @version 1.0
*/
class WDAN_Edit_Admin_Bar extends WDN_Page {
/**
* {@inheritDoc}
*
* @var string
*/
public $id = "wdanp-edit-admin-bar";
/**
* {@inheritDoc}
*
* @var string
*/
public $type = "page";
/**
* {@inheritDoc}
*
* @var string
*/
public $page_menu_dashicon = 'dashicons-menu';
/**
* {@inheritDoc}
*
* @since 2.0.5 - добавлен
* @var bool
*/
public $show_right_sidebar_in_options = false;
/**
* @param WDN_Plugin $plugin
*/
public function __construct( $plugin ) {
$this->menu_title = __( 'Hide adminbar items', 'disable-admin-notices' );
$this->page_menu_short_description = __( 'You can hide an annoying adminbar menu', 'disable-admin-notices' );
parent::__construct( $plugin );
$this->plugin = $plugin;
add_action( 'wp_before_admin_bar_render', [ $this, 'remove_from_admin_bar' ], 999 );
}
/**
* Requests assets (js and css) for the page.
*
* @param Wbcr_Factory480_ScriptList $scripts
* @param Wbcr_Factory480_StyleList $styles
*
* @return void
* @see Wbcr_FactoryPages480_AdminPage
*
*/
public function assets( $scripts, $styles ) {
parent::assets( $scripts, $styles );
$this->styles->add( WDN_PLUGIN_URL . '/admin/assets/css/settings.css' );
}
public function remove_from_admin_bar() {
global $wp_admin_bar;
if ( empty( $wp_admin_bar ) ) {
return;
}
$hidden_items = $this->plugin->getPopulateOption( 'hidden_adminbar_items', [] );
$nodes = [];
foreach ( $wp_admin_bar->get_nodes() as $node ) {
if ( false === $node->parent && ! empty( $node->title ) ) {
if ( "updates" === $node->id ) {
$node->title = "Updates";
}
if ( "comments" === $node->id ) {
$node->title = "Comments";
}
$nodes[ $node->id ] = strip_tags( $node->title );
}
}
$this->plugin->updatePopulateOption( 'adminbar_items', $nodes );
}
public function showPageContent() {
$all_items = $this->plugin->getPopulateOption( 'adminbar_items', [] );
$hidden_items = $this->plugin->getPopulateOption( 'hidden_adminbar_items', [] );
?>
<div class="wrdan-premium-fake-content">
<div class="wdan-premium-info">
<h3>Hide admin bar items (menu) PRO</h3>
<p>This function allows you to disable annoying menu items in the admin bar. Some plugins take up space
in
the admin bar to insert their ads. Just get rid of this ad with the premium features of our
plugin.</p>
<a class="wdan-button wdan-button-default wdan-button-go-pro" target="_blank" href="https://clearfy.pro/disable-admin-notices/">Go
Pro</a>
</div>
<div class="wdan-premium-layer"></div>
<h4>Disable adminbar items</h4>
<table class="wp-list-table widefat fixed striped">
<tr>
<th><strong>Menu title</strong></th>
<th style="width:100px;"><strong>Action</strong></th>
</tr>
<?php foreach ( (array) $all_items as $ID => $title ): ?>
<tr>
<td><?php echo $title; ?></td>
<td>
<?php if ( ! isset( $hidden_items[ $ID ] ) ): ?>
<a style="color:#e66113;" href="<?php echo wp_nonce_url( $this->getActionUrl( 'disable-adminbar-item', [ 'id' => $ID ] ), 'disable_adminbar_item_' . $ID ); ?>">Disable</a>
<?php else: ?>
<a style="color:#428bca;" href="<?php echo wp_nonce_url( $this->getActionUrl( 'enable-adminbar-item', [ 'id' => $ID ] ), 'enable_adminbar_item_' . $ID ); ?>">Enable</a>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</table>
</div>
<?php
}
}

View File

@@ -0,0 +1,164 @@
<?php
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Страница общих настроек для этого плагина.
*
* Не поддерживает режим работы с мультисаймами.
*
* @author Alexander Kovalev <alex.kovalevv@gmail.com>, Github: https://github.com/alexkovalevv
* @copyright (c) 2019 Webraftic Ltd
* @version 1.0
*/
class WDAN_Block_Ad_Redirects extends WDN_Page {
/**
* {@inheritDoc}
*
* @var string
*/
public $id = "wdanp-edit-redirects";
/**
* {@inheritDoc}
*
* @var string
*/
public $type = "page";
/**
* {@inheritDoc}
*
* @var string
*/
public $page_menu_dashicon = 'dashicons dashicons-undo';
/**
* {@inheritDoc}
*
* @since 2.0.5 - добавлен
* @var bool
*/
public $show_right_sidebar_in_options = false;
/**
* @param WDN_Plugin $plugin
*/
public function __construct( $plugin ) {
$this->menu_title = __( 'Block ad redirects', 'disable-admin-notices' );
$this->page_menu_short_description = __( 'Break advertising redirects', 'disable-admin-notices' );
parent::__construct( $plugin );
$this->plugin = $plugin;
}
/**
* Requests assets (js and css) for the page.
*
* @param Wbcr_Factory480_ScriptList $scripts
* @param Wbcr_Factory480_StyleList $styles
*
* @return void
* @see Wbcr_FactoryPages480_AdminPage
*
*/
public function assets( $scripts, $styles ) {
parent::assets( $scripts, $styles );
$this->styles->add( WDN_PLUGIN_URL . '/admin/assets/css/settings.css' );
}
public function get_break_redirects() {
return [];
}
public function showPageContent() {
$redirects = $this->get_break_redirects();
?>
<div class="wrdan-premium-fake-content">
<div class="wdan-premium-info">
<h3>Block Ad redirects PRO</h3>
<p>This feature will be useful to you to break advertising redirects. Some plugins, when updating or
during
installation, may redirect you to their page with advertisements or news. If plugins do this too
often,
it can be a headache for you. Break these redirects with our premium features.</p>
<a class="wdan-button wdan-button-default wdan-button-go-pro" target="_blank" href="https://clearfy.pro/disable-admin-notices/">
Go Pro
</a>
</div>
<div class="wdan-premium-layer"></div>
<h4>Block ad redirects</h4>
<form method="post">
<label for="wdnpro-redirect-url">Enter url for block:</label><br>
<input id="wdnpro-redirect-url" style="width:400px;" type="text" name="wdnpro_redirect_url">
<input type="submit" name="wdnpro_add_block" class="button" value="Add block">
</form>
<br>
<table class="wp-list-table widefat fixed striped">
<tr>
<th>Url</th>
<th style="width:200px;">Action</th>
</tr>
<tr>
<td>
https://site.com/wp-admin/?page=plugin-name&ads=redirect
</td>
<td>
<a style="color:#428bca;" href="#">Unblock</a>
</td>
</tr>
<tr>
<td>
https://site.com/wp-admin/?page=plugin-name&ads=redirect
</td>
<td>
<a style="color:#428bca;" href="#">Unblock</a>
</td>
</tr>
<tr>
<td>
https://site.com/wp-admin/?page=plugin-name&ads=redirect
</td>
<td>
<a style="color:#428bca;" href="#">Unblock</a>
</td>
</tr>
<tr>
<td>
https://site.com/wp-admin/?page=plugin-name&ads=redirect
</td>
<td>
<a style="color:#428bca;" href="#">Unblock</a>
</td>
</tr>
<tr>
<td>
https://site.com/wp-admin/?page=plugin-name&ads=redirect
</td>
<td>
<a style="color:#428bca;" href="#">Unblock</a>
</td>
</tr>
<tr>
<td>
https://site.com/wp-admin/?page=plugin-name&ads=redirect
</td>
<td>
<a style="color:#428bca;" href="#">Unblock</a>
</td>
</tr>
</table>
</div>
<?php
}
}

View File

@@ -0,0 +1,103 @@
<?php
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Страница лицензирования плагина.
*
* Поддерживает режим работы с мультисаймами. Вы можете увидеть эту страницу в панели настройки сети.
*
* @author Alex Kovalev <alex.kovalevv@gmail.com>, Github: https://github.com/alexkovalevv
*
* @copyright (c) 2018 Webraftic Ltd
*/
class WDN_LicensePage extends WBCR\Factory_Templates_134\Pages\License {
/**
* {@inheritdoc}
*
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
* @since 1.6.0
* @var string
*/
public $id = 'wdn_license';
/**
* {@inheritdoc}
*
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
* @since 1.6.0
* @var string
*/
public $page_parent_page;
/**
* WCL_LicensePage constructor.
*
* @param \Wbcr_Factory480_Plugin $plugin
*
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
*
*/
public function __construct( Wbcr_Factory480_Plugin $plugin ) {
$this->menu_title = __( 'License', 'robin-image-optimizer' );
$this->page_menu_short_description = __( 'Product activation', 'robin-image-optimizer' );
$this->plan_name = __( 'Disable admin notices premium', 'robin-image-optimizer' );
/*if ( defined( 'WIO_PLUGIN_ACTIVE' ) && ! wrio_is_clearfy_license_activate() ) {
$this->page_parent_page = 'none';
}*/
parent::__construct( $plugin );
/**
* Adds a new plugin card to license components page
*
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
* @since 1.6.2
*/
/*add_filter( 'wbcr/clearfy/license/list_components', function ( $components ) {
$title = 'Free';
$icon = 'clearfy-premium-icon-256x256--lock.png';
if ( $this->is_premium ) {
$title = 'Premium';
$icon = 'clearfy-premium-icon-256x256--default.png';
}
$components[] = [
'name' => 'clearfy',
'title' => sprintf( __( 'Clearfy [%s]', 'clearfy' ), $title ),
'type' => 'internal',
'build' => $this->is_premium ? 'premium' : 'free',
'key' => $this->get_hidden_license_key(),
'plan' => $this->get_plan(),
'expiration_days' => $this->get_expiration_days(),
'quota' => $this->is_premium ? $this->premium_license->get_count_active_sites() . ' ' . __( 'of', 'clearfy' ) . ' ' . $this->premium_license->get_sites_quota() : null,
'subscription' => $this->is_premium && $this->premium_has_subscription ? sprintf( __( 'Automatic renewal, every %s', '' ), esc_attr( $this->get_billing_cycle_readable() ) ) : null,
'url' => 'https://clearfy.pro/',
'icon' => WCL_PLUGIN_URL . '/admin/assets/img/' . $icon,
'description' => __( 'Public License is a GPLv3 compatible license allowing you to change and use this version of the plugin for free. Please keep in mind this license covers only free edition of the plugin. Premium versions are distributed with other type of a license.', 'clearfy' ),
'license_page_id' => 'clearfy_license'
];
return $components;
} );*/
}
/**
* {@inheritdoc}
*
* @return string
* @since 1.6.0
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
*/
/*public function get_plan_description() {
$description = '<p style="font-size: 16px;">' . __( '<b>Clearfy Business</b> is a paid package of components for the popular free WordPress plugin named Clearfy. You get access to all paid components at one price.', 'clearfy' ) . '</p>';
$description .= '<p style="font-size: 16px;">' . __( 'Paid license guarantees that you can download and update existing and future paid components of the plugin.', 'clearfy' ) . '</p>';
return $description;
}*/
}

View File

@@ -0,0 +1,91 @@
<?php
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Страница со списком скрытых нотисов.
*
* @author Artem Prihodko <webtemyk@yandex.ru>
* @copyright (c) 2020 Webraftic Ltd
* @version 1.0
*/
class WDAN_Notices extends WDN_Page {
/**
* {@inheritDoc}
*
* @var string
*/
public $id = "wdan-notices";
/**
* {@inheritDoc}
*
* @var string
*/
public $type = "page";
/**
* {@inheritDoc}
*
* @var string
*/
public $page_menu_dashicon = 'dashicons-hidden';
/**
* {@inheritDoc}
*
* @since 2.0.5 - добавлен
* @var bool
*/
public $show_right_sidebar_in_options = false;
/**
* @param WDN_Plugin $plugin
*/
public function __construct( $plugin ) {
$this->menu_title = __( 'Hidden notices', 'disable-admin-notices' );
$this->page_menu_short_description = __( 'Manage hidden notices', 'disable-admin-notices' );
parent::__construct( $plugin );
$this->plugin = $plugin;
}
/**
* Requests assets (js and css) for the page.
*
* @param Wbcr_Factory480_ScriptList $scripts
* @param Wbcr_Factory480_StyleList $styles
*
* @return void
* @see Wbcr_FactoryPages480_AdminPage
*
*/
public function assets( $scripts, $styles ) {
parent::assets( $scripts, $styles );
$this->styles->add( WDN_PLUGIN_URL . '/admin/assets/css/settings.css' );
}
public function showPageContent() {
?>
<div class="wrdan-premium-fake-content">
<div class="wdan-premium-info">
<h3>Hidden notices PRO</h3>
<p>This function allows you to disable annoying menu items in the admin bar. Some plugins take up space
in
the admin bar to insert their ads. Just get rid of this ad with the premium features of our
plugin.</p>
<a class="wdan-button wdan-button-default wdan-button-go-pro" target="_blank"
href="https://clearfy.pro/disable-admin-notices/">Go
Pro</a>
</div>
</div>
<?php
}
}

View File

@@ -0,0 +1,149 @@
<?php
/**
* Страница общих настроек для этого плагина.
*
* Может быть использована только, если этот плагин используется как отдельный плагин, а не как аддон
* дя плагина Clearfy. Если плагин загружен, как аддон для Clearfy, эта страница не будет подключена.
*
* Поддерживает режим работы с мультисаймами. Вы можете увидеть эту страницу в панели настройки сети.
*
* Github: https://github.com/alexkovalevv
*
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
* @copyright (c) 2018 Webraftic Ltd
* @version 1.0
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
class WDN_Settings_Page extends WDN_Page {
/**
* {@inheritDoc}
*
* @var string
*/
public $id = "wdan_settings";
/**
* {@inheritDoc}
*
* @var string
*/
public $page_menu_dashicon = 'dashicons-admin-generic';
/**
* {@inheritDoc}
*
* @var bool
*/
public $available_for_multisite = true;
/**
* {@inheritDoc}
*
* @since 1.1.0
* @var bool
*/
public $show_right_sidebar_in_options = true;
/**
* {@inheritDoc}
*
* @since 1.1.3 - Added
* @var bool - true show, false hide
*/
public $show_search_options_form = false;
/**
* {@inheritDoc}
* @var int
*/
public $page_menu_position = 100;
/**
* @param Wbcr_Factory480_Plugin $plugin
*/
public function __construct( Wbcr_Factory480_Plugin $plugin ) {
$this->menu_title = __( 'Hide admin notices', 'disable-admin-notices' );
$this->page_menu_short_description = __( 'General settings', 'disable-admin-notices' );
$this->internal = false;
$this->menu_target = 'options-general.php';
$this->add_link_to_plugin_actions = true;
parent::__construct( $plugin );
$this->plugin = $plugin;
}
public function getPageTitle() {
return __( 'Settings', 'disable-admin-notices' );
}
/**
* Requests assets (js and css) for the page.
*
* @param Wbcr_Factory480_ScriptList $scripts
* @param Wbcr_Factory480_StyleList $styles
*
* @return void
* @see Wbcr_FactoryPages480_AdminPage
*
*/
public function assets( $scripts, $styles ) {
parent::assets( $scripts, $styles );
$this->styles->add( WDN_PLUGIN_URL . '/admin/assets/css/settings.css' );
$this->scripts->add( WDN_PLUGIN_URL . '/admin/assets/js/settings.js' );
}
/**
* {@inheritDoc}
*
* @return array
*/
public function actionsNotice( $notices ) {
$notices[] = [
'conditions' => [
'wbcr_dan_reseted_notices' => 1
],
'type' => 'success',
'message' => __( 'Hidden notices are successfully reset, now you can see them again!', 'disable-admin-notices' )
];
/*$notices[] = array(
'conditions' => array(
'wbcr_dan_clear_comments_error' => 1,
'wbcr_dan_code' => 'interal_error'
),
'type' => 'danger',
'message' => __('An error occurred while trying to delete comments. Internal error occured. Please try again later.', 'factory_pages_480')
);*/
return $notices;
}
/**
* {@inheritDoc}
*
* @return array
*/
public function getPageOptions() {
$options = wbcr_dan_get_plugin_options();
$formOptions = [];
$formOptions[] = [
'type' => 'form-group',
'items' => $options,
//'cssClass' => 'postbox'
];
return apply_filters( 'wbcr_dan_notices_form_options', $formOptions, $this );
}
}

View File

@@ -0,0 +1,2 @@
<?php
// Silence is golden.