Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/ninja-fo.../deprecat.../includes/admin
File: notices.php
<?php if ( ! defined( 'ABSPATH' ) ) exit;
[0] Fix | Delete
[1] Fix | Delete
/**
[2] Fix | Delete
* Notices page to house all of the admin notices for Core
[3] Fix | Delete
*
[4] Fix | Delete
* Can be simply used be adding another line into the nf_admin_notices() function
[5] Fix | Delete
*
[6] Fix | Delete
* The class NF_Notices in notices-class.php can be extended to create more advanced notices to include triggered events
[7] Fix | Delete
*
[8] Fix | Delete
* @since 2.9
[9] Fix | Delete
*/
[10] Fix | Delete
[11] Fix | Delete
function nf_admin_notices( $notices ) {
[12] Fix | Delete
[13] Fix | Delete
if( ! ninja_forms_three_addons_check() || ( ninja_forms_three_addons_version_check() && ninja_forms_three_addons_check() ) ){
[14] Fix | Delete
[15] Fix | Delete
[16] Fix | Delete
/*
[17] Fix | Delete
* Upgrade Now
[18] Fix | Delete
*/
[19] Fix | Delete
$upgrade_link = admin_url( 'admin.php?page=ninja-forms-three' );
[20] Fix | Delete
$notice = array(
[21] Fix | Delete
'title' => __( 'Upgrade to Ninja Forms THREE', 'ninja-forms' ),
[22] Fix | Delete
'link' => '',
[23] Fix | Delete
'int' => 0,
[24] Fix | Delete
'blacklist' => array( 'ninja-forms', 'ninja-forms-three' ),
[25] Fix | Delete
);
[26] Fix | Delete
if ( ! get_option( 'ninja_forms_has_invalid_addons' ) ) {
[27] Fix | Delete
$notice[ 'msg' ] = sprintf( __( 'You are eligible to upgrade to Ninja Forms THREE! %sUpgrade Now%s', 'ninja-forms' ), '<a target="_blank" href="' . $upgrade_link . '">', '</a>' );
[28] Fix | Delete
} else {
[29] Fix | Delete
if ( ! function_exists( 'get_plugins' ) ) {
[30] Fix | Delete
// Require the core file.
[31] Fix | Delete
require_once ABSPATH . 'wp-admin/includes/plugin.php';
[32] Fix | Delete
}
[33] Fix | Delete
// Get a list of plugins.
[34] Fix | Delete
$plugins = get_plugins();
[35] Fix | Delete
$not_ours = array();
[36] Fix | Delete
// For each plugin...
[37] Fix | Delete
foreach( $plugins as $plugin => $data ){
[38] Fix | Delete
// If this isn't Ninja Forms Core...
[39] Fix | Delete
// AND If it includes a ninja-forms prefix...
[40] Fix | Delete
if ( 'ninja-forms/ninja-forms.php' != $plugin && 0 === strncmp( $plugin, 'ninja-forms-', 12 ) ){
[41] Fix | Delete
// Get the plugin slug.
[42] Fix | Delete
$slug = explode( '/', $plugin );
[43] Fix | Delete
// If the plugin is not active...
[44] Fix | Delete
// Exit early.
[45] Fix | Delete
if ( ! is_plugin_active( $plugin ) ) continue;
[46] Fix | Delete
// If the plugin is not in our list...
[47] Fix | Delete
if ( ! ninja_forms_valid_slug( $slug[ 0 ] ) ) {
[48] Fix | Delete
// Add it onto our array of data
[49] Fix | Delete
$not_ours[ $plugin ] = $data;
[50] Fix | Delete
}
[51] Fix | Delete
}
[52] Fix | Delete
}
[53] Fix | Delete
$display = sprintf( __( 'You are eligible to upgrade to Ninja Forms THREE! However, the following plugins are not compatible with Ninja Forms THREE and could lead to issues with the upgrade process.%sPlease deactivate and remove the following before attempting to upgrade:%s', 'ninja-forms' ), '<br />', '<br />' );
[54] Fix | Delete
foreach( $not_ours as $plugin ) {
[55] Fix | Delete
$display .= __( $plugin[ 'Name' ], $plugin[ 'TextDomain' ] ) . ', ';
[56] Fix | Delete
}
[57] Fix | Delete
$display = substr( $display, 0, strlen( $display ) - 2 );
[58] Fix | Delete
$notice[ 'msg' ] = $display;
[59] Fix | Delete
$notice[ 'blacklist' ] = array( 'ninja-forms-three' );
[60] Fix | Delete
}
[61] Fix | Delete
$notices['three_upgrade'] = $notice;
[62] Fix | Delete
} else {
[63] Fix | Delete
[64] Fix | Delete
/*
[65] Fix | Delete
* THREE is Coming!
[66] Fix | Delete
*/
[67] Fix | Delete
$three_info = add_query_arg( array( 'nf_admin_notice_ignore' => 'three_info' ) );
[68] Fix | Delete
$three_link = nf_aff_link( 'https://ninjaforms.com/three/?utm_source=Ninja+Forms+Plugin+Deprecated&utm_medium=Dashboard+Banner+Ad+Deprecated' );
[69] Fix | Delete
$notices['three_info'] = array(
[70] Fix | Delete
'title' => __( 'THREE is coming!', 'ninja-forms' ),
[71] Fix | Delete
'msg' => sprintf( __( 'A major update is coming to Ninja Forms. %sLearn more about new features, backwards compatibility, and more Frequently Asked Questions.%s', 'ninja-forms' ), '<a target="_blank" href="' . $three_link . '">', '</a>' ),
[72] Fix | Delete
'link' => '',
[73] Fix | Delete
'int' => 0,
[74] Fix | Delete
'blacklist' => array( 'ninja-forms', 'ninja-forms-three' ),
[75] Fix | Delete
);
[76] Fix | Delete
[77] Fix | Delete
}
[78] Fix | Delete
[79] Fix | Delete
[80] Fix | Delete
[81] Fix | Delete
$one_week_support = add_query_arg( array( 'nf_admin_notice_ignore' => 'one_week_support' ) );
[82] Fix | Delete
$support_link = nf_aff_link( 'https://ninjaforms.com/contact/?utm_source=Ninja+Forms+Plugin+Deprecated&utm_medium=System+Status+Banner+Ad+Deprecated' );
[83] Fix | Delete
$support_docs_link = nf_aff_link( 'http://docs.ninjaforms.com/?utm_source=Ninja+Forms+Plugin+Deprecated&utm_medium=System+Status+Banner+Ad+Deprecated' );
[84] Fix | Delete
$notices['one_week_support'] = array(
[85] Fix | Delete
'title' => __( 'How\'s It Going?', 'ninja-forms' ),
[86] Fix | Delete
'msg' => __( 'Thank you for using Ninja Forms! We hope that you\'ve found everything you need, but if you have any questions:', 'ninja-forms' ),
[87] Fix | Delete
'link' => '<li><span class="dashicons dashicons-media-text"></span><a target="_blank" href="' . $support_docs_link . '">' . __( 'Check out our documentation', 'ninja-forms' ) . '</a></li>
[88] Fix | Delete
<li><span class="dashicons dashicons-sos"></span><a target="_blank" href="' . $support_link . '">' . __( 'Get Some Help' ,'ninja-forms' ) . '</a></li>
[89] Fix | Delete
<li><span class="dashicons dashicons-dismiss"></span><a href="' . $one_week_support . '">' . __( 'Dismiss' ,'ninja-forms' ) . '</a></li>',
[90] Fix | Delete
'int' => 7,
[91] Fix | Delete
'blacklist' => array( 'ninja-forms-three' ),
[92] Fix | Delete
);
[93] Fix | Delete
[94] Fix | Delete
// $two_week_review_ignore = add_query_arg( array( 'nf_admin_notice_ignore' => 'two_week_review' ) );
[95] Fix | Delete
// $two_week_review_temp = add_query_arg( array( 'nf_admin_notice_temp_ignore' => 'two_week_review', 'int' => 14 ) );
[96] Fix | Delete
// $notices['two_week_review'] = array(
[97] Fix | Delete
// 'title' => __( 'Leave A Review?', 'ninja-forms' ),
[98] Fix | Delete
// 'msg' => __( 'We hope you\'ve enjoyed using Ninja Forms! Would you consider leaving us a review on WordPress.org?', 'ninja-forms' ),
[99] Fix | Delete
// 'link' => '<li> <span class="dashicons dashicons-smiley"></span><a href="' . $two_week_review_ignore . '"> ' . __( 'I\'ve already left a review', 'ninja-forms' ) . '</a></li>
[100] Fix | Delete
// <li><span class="dashicons dashicons-calendar-alt"></span><a href="' . $two_week_review_temp . '">' . __( 'Maybe Later' ,'ninja-forms' ) . '</a></li>
[101] Fix | Delete
// <li><span class="dashicons dashicons-external"></span><a href="http://wordpress.org/support/view/plugin-reviews/ninja-forms?filter=5" target="_blank">' . __( 'Sure! I\'d love to!', 'ninja-forms' ) . '</a></li>',
[102] Fix | Delete
// 'int' => 14
[103] Fix | Delete
// );
[104] Fix | Delete
[105] Fix | Delete
[106] Fix | Delete
return $notices;
[107] Fix | Delete
}
[108] Fix | Delete
// This function is used to hold all of the basic notices
[109] Fix | Delete
// Date format accepts most formats but can get confused so preferred methods are m/d/Y or d-m-Y
[110] Fix | Delete
[111] Fix | Delete
add_filter( 'nf_admin_notices', 'nf_admin_notices' );
[112] Fix | Delete
[113] Fix | Delete
// Require any files that contain class extensions for NF_Notices
[114] Fix | Delete
require_once( NF_PLUGIN_DIR . 'classes/notices-multipart.php' );
[115] Fix | Delete
[116] Fix | Delete
// Require any files that contain class extensions for NF_Notices
[117] Fix | Delete
require_once( NF_PLUGIN_DIR . 'classes/notices-save-progress.php' );
[118] Fix | Delete
[119] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function