Commit inicial - WordPress Análisis de Precios Unitarios

- WordPress core y plugins
- Tema Twenty Twenty-Four configurado
- Plugin allow-unfiltered-html.php simplificado
- .gitignore configurado para excluir wp-config.php y uploads

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-11-03 21:04:30 -06:00
commit a22573bf0b
24068 changed files with 4993111 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
.display-inline-block{display:inline-block}.spacer{height:20px}.section-part{position:relative;margin-bottom:20px;padding:10px 20px;border:1px solid #ccc;background-color:#fff}.section-part.border-warning{background-color:rgba(255,255,255,.5)}.section-part.border-warning .option-container{opacity:1 !important;color:red}.section-part.border-warning .option-container.active{color:inherit}.section-part.extra .dashicons-before:before{font-size:14px}.wrap.page-width{max-width:760px}.modules{position:relative;margin:0;display:flex;flex-wrap:wrap}.modules .card{display:block;max-width:440px;min-height:240px;margin:0 15px 15px 0}@media only screen and (max-width: 500px){.modules .card{margin:15px 0}}.sections-container .option-container{opacity:.5;display:block;padding-top:5px;padding-bottom:5px;position:relative;padding-left:30px}.sections-container .option-container:hover,.sections-container .option-container.active{opacity:1}.sections-container .option-container input[type=checkbox]{position:absolute;top:20px;left:0px}@media only screen and (max-width: 782px){.sections-container .option-container input[type=checkbox]{left:-7px}}.sections-container .text-container{display:block}.sections-container .text-container input[type=text],.sections-container .text-container input[type=email]{display:block;width:100%;margin:5px 0}.nav-tab{cursor:pointer}.nav-tab .dashicons-before:before{position:relative;top:2px}.nav-tab .dashicons-admin-plugins.active{opacity:1;color:#46b450}.nav-tab .dashicons-admin-plugins.inactive{opacity:1;color:#bd003f}.switch{position:relative;display:block;float:right;right:-17px;width:40px;height:17px;cursor:default}.switch input{display:none}.slider{position:absolute;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,.2);-webkit-transition:.4s;transition:.4s}.slider:before{position:absolute;content:"";height:13px;width:13px;left:2px;bottom:2px;background-color:#fff;-webkit-transition:.2s;transition:.2s}.slider.active{background-color:#76d450}.slider.changing{background-color:#0073aa}.slider.active:before{-webkit-transform:translateX(23px);-ms-transform:translateX(23px);transform:translateX(23px)}.on,.off{color:#fff;position:absolute;top:0;left:5px;width:30px;font-size:8px;font-family:Verdana,sans-serif;text-align:right;user-select:none;-webkit-touch-callout:none;-webkit-user-select:none}.on{text-align:left;display:none}.active .off{display:none}.active .on{display:block}.slider.round{border-radius:17px;width:40px;height:17px}.slider.round:before{border-radius:50%}.donation-box{background-color:rgba(255,255,255,.5);margin-right:10px;padding:40px;text-align:center;color:rgba(0,0,0,.7)}
/*# sourceMappingURL=main.min.css.map?1621860351981*/

View File

@@ -0,0 +1 @@
{"version":3,"sources":["webpack://local.freeamigos.nl/./src/manage-notifications-emails/main.scss"],"names":[],"mappings":"AAAA,sBAEE,qBAEF,QAEI,YAKJ,cAEI,kBACA,mBACA,kBACA,sBACA,sBAEA,6BAUI,sCARA,+CAEI,qBACA,UACA,sDACI,cAKZ,6CAEI,eAIR,iBAEI,gBAGJ,SACI,kBACA,SACA,aACA,eACA,eACI,cACA,gBACA,iBACA,qBACA,0CALJ,eAMQ,eAOZ,sCAEI,WAQA,cACA,gBACA,mBACA,kBACA,kBAXA,yFAEI,UAUJ,2DACI,kBACA,SACA,SACA,0CAJJ,2DAKQ,WAMZ,oCAEI,cAEA,2GAGI,cACA,WACA,aAIR,SAEI,eAEA,kCAEI,kBACA,QAGJ,yCAEI,UACA,cAGJ,2CAEI,UACA,cAOR,QACI,kBACA,cACA,YACA,YACA,WACA,YACA,eAGF,2BAEA,QACE,kBACA,MACA,OACA,QACA,SACA,gCACA,uBACA,eAGF,eACE,kBACA,WACA,YACA,WACA,SACA,WACA,sBACA,uBACA,eAEF,eACE,yBAEF,iBACE,yBAGF,sBACE,mCACA,+BACA,2BAIF,SAEE,WACA,kBACA,MACA,SACA,WACA,cACA,+BACA,iBACA,iBACA,2BACA,yBAEF,IAEE,gBACA,aAGF,0BACA,0BAKA,cACE,mBACA,WACA,YAGF,qBACE,kBAGJ,cACI,sCACA,kBACA,aACA,kBACA,qB","file":"main.min.css?1621860351981","sourcesContent":[".display-inline-block\n{\n display:inline-block;\n}\n.spacer\n{\n height:20px;\n}\n\n\n\n.section-part\n{\n position:relative;\n margin-bottom:20px;\n padding:10px 20px;\n border:1px solid #CCC;\n background-color:#FFF;\n\n &.border-warning\n {\n .option-container\n {\n opacity:1 !important;\n color:#F00;\n &.active{\n color:inherit;\n }\n }\n background-color:rgba(255,2555,255,.5);\n }\n &.extra .dashicons-before:before\n {\n font-size:14px;\n }\n}\n\n.wrap.page-width\n{\n max-width:760px;\n}\n\n.modules{\n position: relative;\n margin:0;\n display:flex;\n flex-wrap: wrap;\n .card{\n display:block;\n max-width:440px;\n min-height:240px;\n margin:0 15px 15px 0;\n @media only screen and (max-width: 500px) {\n margin:15px 0;\n }\n }\n}\n\n\n\n.sections-container .option-container\n {\n opacity:.5;\n &:hover,\n &.active{\n opacity:1;\n }\n\n\n\n display:block;\n padding-top:5px;\n padding-bottom:5px;\n position: relative;\n padding-left:30px;\n input[type=checkbox]{\n position: absolute;\n top:20px;\n left:0px;\n @media only screen and (max-width: 782px) {\n left:-7px;\n }\n \n }\n}\n\n.sections-container .text-container\n{\n display: block;\n\n input[type=text],\n input[type=email]\n {\n display: block;\n width:100%;\n margin:5px 0;\n }\n}\n\n.nav-tab \n{\n cursor:pointer;\n\n .dashicons-before:before\n {\n position: relative;\n top:2px;\n }\n\n .dashicons-admin-plugins.active\n {\n opacity:1;\n color:#46b450;\n }\n\n .dashicons-admin-plugins.inactive\n {\n opacity:1;\n color: rgb(189, 0, 63);;\n }\n}\n\n\n\n/*SWITCH */\n.switch {\n position: relative;\n display: block;\n float:right;\n right:-17px;\n width: 40px;\n height: 17px;\n cursor: default;\n }\n \n .switch input {display:none;}\n \n .slider {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(0,0,0,.2);\n -webkit-transition: .4s;\n transition: .4s;\n }\n \n .slider:before {\n position: absolute;\n content: \"\";\n height: 13px;\n width: 13px;\n left: 2px;\n bottom: 2px;\n background-color: white;\n -webkit-transition: .2s;\n transition: .2s;\n }\n .slider.active {\n background-color: #76d450;\n }\n .slider.changing {\n background-color: #0073aa;\n }\n\n .slider.active:before {\n -webkit-transform: translateX(23px);\n -ms-transform: translateX(23px);\n transform: translateX(23px);\n }\n \n /*------ ADDED CSS ---------*/\n .on, .off\n {\n color: white;\n position: absolute;\n top:0;\n left: 5px;\n width:30px;\n font-size: 8px;\n font-family: Verdana, sans-serif;\n text-align:right;\n user-select: none;\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none;\n }\n .on\n {\n text-align:left;\n display: none;\n }\n\n .active .off{ display:none;}\n .active .on{ display:block;}\n\n /*--------- END --------*/\n \n /* Rounded sliders */\n .slider.round {\n border-radius: 17px;\n width:40px;\n height:17px;\n }\n \n .slider.round:before {\n border-radius: 50%;}\n\n\n.donation-box{\n background-color:rgba(255,255,255,.5);\n margin-right:10px;\n padding:40px;\n text-align:center;\n color:rgba(0,0,0,0.7);\n}"],"sourceRoot":""}

View File

@@ -0,0 +1,2 @@
!function(e){var t,a,n="settings",s=document.location.hash.replace("#","");function i(t){e(".sections-container").addClass("hidden"),e("#sections-"+t).removeClass("hidden"),e(".nav-tab-wrapper>a").removeClass("nav-tab-active"),e(".nav-tab-wrapper>a#tab-"+t).addClass("nav-tab-active"),document.location="#"+t}e(window).on("hashchange",(function(){i(s=document.location.hash.replace("#",""))})),document.cookie.length>0&&-1!==(t=document.cookie.indexOf("famnetab="))&&(t+=9,-1===(a=document.cookie.indexOf(";",t))&&(a=document.cookie.length),n=unescape(document.cookie.substring(t,a))),""!==s&&(n=s),e(".sections-container").each((function(){var t=e(this).attr("id").replace("sections-",""),a=e(this).attr("title"),n=e(this).attr("data-icon"),s=e('<a id="tab-'+t+'" class="nav-tab">'+(""!==n?'<span class="dashicons-before '+n+'"></span>':"")+a+"</a>");s.on("click",(function(){document.cookie="famnetab="+t,i(t)})),e(".nav-tab-wrapper").append(s)})),i(n),e('input[name="famne_options[custom_admin_recipients]"]').on("change",(function(){var t=e(this).closest(".card"),a=e(this).val();if(e(this).closest(".text-container").removeClass("error"),""!==e(this).val()){e(".switch .slider",t).addClass("active");var n,s=a.split(",");for(var i in s)n=s[i].replace(" ",""),/^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(n)||e(this).closest(".text-container").addClass("error")}else e(".switch .slider",t).removeClass("active")})),e(".checkbox-change").on("change",(function(){var t=e(this).closest(".option-container"),a=e(this).closest(".card");e(this).is(":checked")?t.addClass("active"):t.removeClass("active"),0===e(".option-container.active",a).length?e(".switch .slider",a).removeClass("active"):e(".switch .slider",a).addClass("active")})),e("input[type='file']#settings-upload-file").on("change",(function(){var t=e(this).attr("data-message");e("#settings-upload-submit").removeAttr("disabled").on("click",(function(){return confirm(t)}))}))}(jQuery);
//# sourceMappingURL=main.min.js.map?1621860351981

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,403 @@
<?php
/**
* Manage notification emails settings page class
*
* Displays the settings page.
*
* This file is part of the Manage Notification Emails plugin
* You can find out more about this plugin at https://www.freeamigos.nl
* Copyright (c) 2006-2015 Virgial Berveling
*
* @package WordPress
* @author Virgial Berveling
* @copyright 2006-2015
*
* version: 1.3.1
*/
if ( ! class_exists( 'FAMNESettingsPage' ) ) :
/**
* FAMNESettingsPage
*/
class FAMNESettingsPage {
private $options;
const MENU_SLUG = 'famne-admin';
const MENU_NETWORK_SLUG = 'famne-network-admin';
private $tabs = array();
private static $sections = array();
/**
* Start up
*/
public function __construct() {
add_action( 'admin_init', array( $this, 'page_init' ) );
if ( current_user_can( 'manage_network_options' ) ) :
add_action( 'network_admin_menu', array( $this, 'network_admin_menu' ) );
add_action( 'network_admin_edit_famnesavenetwork', array( $this, 'save_networksettings' ) );
add_action( 'network_admin_notices', array( $this, 'custom_notices' ) );
endif;
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
add_filter( 'plugin_action_links_' . FA_MNE_PLUGIN_BASENAME, array( $this, 'add_action_links' ) );
add_action( 'init', array( $this, 'famne_load_textdomain' ) );
}
/**
* Add options page
*/
public function network_admin_menu() {
// This page will be under "Settings".
add_submenu_page(
'settings.php', // Parent element.
'Notification e-mails', // Text in browser title bar.
'Notification e-mails', // Text to be displayed in the menu.
'manage_options', // Capability.
self::MENU_NETWORK_SLUG, // Page slug, will be displayed in URL.
array( $this, 'print_admin_page' )
);
$this->addTabs();
add_action( 'admin_init', array( $this, 'load_scripts' ) );
}
/**
* Add options page
*/
public function admin_menu() {
// This page will be under "Settings".
add_options_page(
'Settings Admin',
'Notification e-mails',
'manage_options',
self::MENU_SLUG,
array( $this, 'print_admin_page' )
);
$this->addTabs();
add_action( 'admin_init', array( $this, 'load_scripts' ) );
}
public function custom_notices() {
if ( self::is_famne_network_settings_page() && isset( $_GET['updated'] ) ) {
echo '<div id="message" class="updated notice is-dismissible"><p>' . esc_html__( 'Settings updated.', 'manage-notification-emails' ) . '</p><button type="button" class="notice-dismiss"><span class="screen-reader-text">' . esc_html__( 'Dismiss this notice.', 'manage-notification-emails' ) . '</span></button></div>';
}
}
/**
* Add Tabs
*
* @return void
*/
private function addTabs() {
if ( self::is_famne_network_settings_page() ) :
$this->tabs[5] = array(
'title' => __( 'Network options', 'manage-notification-emails' ),
'slug' => 'network',
'view_file' => 'network.php',
'icon' => 'dashicons-admin-multisite',
);
endif;
if ( ! self::is_famne_network_settings_page() || FAMNE::get_option( 'famne_network_managed' ) ) :
$this->tabs[10] = array(
'title' => __( 'Core options', 'manage-notification-emails' ),
'slug' => 'settings',
'view_file' => 'settings.php',
'icon' => 'dashicons-admin-settings',
);
$this->tabs[30] = array(
'title' => __( 'Modules', 'manage-notification-emails' ),
'slug' => 'modules',
'view_file' => 'modules.php',
'icon' => 'dashicons-admin-plugins',
);
$this->tabs[90] = array(
'title' => __( 'Information', 'manage-notification-emails' ),
'slug' => 'extra',
'view_file' => 'extra.php',
'icon' => 'dashicons-editor-help',
);
endif;
}
/**
* Register and add settings
*/
public function page_init() {
register_setting(
'famne_option_group', // Option group.
'famne_options', // Option name.
array( $this, 'sanitize' ) // Sanitize.
);
add_settings_section(
'setting_section_id', // ID.
'', // Title.
array( $this, 'print_section_info' ), // Callback.
self::MENU_SLUG // Page.
);
if ( isset( $_GET['famne_reset'] ) && is_string( $_GET['famne_reset'] ) && '1' === $_GET['famne_reset'] ) {
$this->reset_settings();
}
}
/**
* Check if is_famne_settings_page
*
* @return boolean
*/
public static function is_famne_settings_page() {
global $pagenow;
$getpage = isset( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : '';
$is_admin_page = 'options-general.php' === $pagenow && self::MENU_SLUG === $getpage;
return $is_admin_page;
}
/**
* Check if is_famne_network_settings_page
*
* @return boolean
*/
public static function is_famne_network_settings_page() {
global $pagenow;
$getpage = isset( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : '';
$is_network_admin_page = 'settings.php' === $pagenow && self::MENU_NETWORK_SLUG === $getpage;
return $is_network_admin_page;
}
/**
* Load_scripts
*
* @return void
*/
public function load_scripts() {
if ( ! self::is_famne_settings_page() && ! self::is_famne_network_settings_page() ) {
return;
}
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
}
/**
* Sanitize each setting field as needed
*
* @param array $input Contains all settings fields as array keys.
*/
public function sanitize( $input ) {
if ( empty( $input ) ) {
$input = array();
}
$new_input = array();
foreach ( $input as $key => $val ) {
$new_input[ $key ] = '1' === strval( $val ) ? '1' : '';
}
foreach ( FAMNE::getModules() as $mod ) :
if ( ! empty( $mod->option_id ) && is_array( $mod->option_id ) ) :
foreach ( $mod->option_id as $m ) :
if ( isset( $input[ $m ] ) ) {
$new_input[ $m ] = $input[ $m ];
}
endforeach;
endif;
endforeach;
$new_input = apply_filters( 'famne_sanitize_settings_page', $new_input );
return $new_input;
}
public function save_networksettings() {
if ( ! current_user_can( 'manage_network_options' ) ) {
check_admin_referer( 'fake_info_action', 'fake_info' );
exit;
}
if ( ! empty( $_POST ) && check_admin_referer( 'famnenetwork_save', 'famnenetwork' ) ) {
$network_activated = FAMNE::get_option( 'famne_network_managed' );
$network_managed = ! empty( $_POST['famne_options'] ) && '1' === $_POST['famne_options']['network_managed'] ? '1' : null;
FAMNE::update_option( 'famne_network_managed', $network_managed );
if ( $network_managed ) :
$options = $_POST['famne_options'];
if ( empty( $network_activated ) ) :
$options = FAMNE::default_options();
endif;
$options = $this->sanitize( $options );
/* Since 1.8.1 */
if ( ! empty( $options['wp_new_user_notification_to_admin'] ) ) {
update_site_option( 'registrationnotification', 'yes' );
} else {
update_site_option( 'registrationnotification', 'no' );
}
FAMNE::update_option( 'famne_options', $options );
endif;
wp_safe_redirect(
add_query_arg(
array(
'page' => self::MENU_NETWORK_SLUG,
'updated' => true,
),
network_admin_url( 'settings.php' )
)
);
exit;
}
}
private function reset_settings() {
if ( ! isset( $_GET['famne_reset'] ) || ! is_string( $_GET['famne_reset'] ) || '1' !== $_GET['famne_reset'] || ! isset( $_GET['nonce'] ) ) :
return;
endif;
if ( ! wp_verify_nonce( $_GET['nonce'], 'famne_reset' ) ) :
wp_nonce_ays( '' );
die();
endif;
if ( self::is_famne_settings_page() ) :
delete_option( 'fa_mne_version' );
delete_option( 'famne_options' );
FAMNE::install();
echo "<script>document.location='" . admin_url( 'options-general.php?page=famne-admin&updated=1' ) . "'</script>";
elseif ( self::is_famne_network_settings_page() ) :
delete_site_option( 'fa_mne_version' );
delete_site_option( 'famne_options' );
FAMNE::install();
echo "<script>document.location='" . admin_url( 'network/settings.php?page=famne-network-admin&updated=1' ) . "'</script>";
endif;
exit;
}
/**
* Print admin_page
*
* @return void
*/
public function print_admin_page() {
global $famne_options;
global $pagenow;
$famne_options = FAMNE::get_option( 'famne_options' );
foreach ( $this->tabs as $key => $tab ) :
self::register_section( $tab, $key );
endforeach;
do_action( 'famne_register_settings_section' );
if ( self::is_famne_network_settings_page() ) :
include_once dirname( __FILE__ ) . '/views/container-network.php';
else :
include_once dirname( __FILE__ ) . '/views/container.php';
endif;
}
/**
* Register section
*
* @param mixed $section
* @param mixed $ord
* @return void
*/
public static function register_section( $section, $ord = 99 ) {
self::$sections[ $ord ] = $section;
}
/**
* Print registered sections
*
* @param mixed $output
* @return void
*/
public static function print_sections( $output = true ) {
require_once dirname( __FILE__ ) . '/formfields.php';
ksort( self::$sections );
foreach ( self::$sections as &$section ) {
$icon = ! empty( $section['icon'] ) ? 'data-icon="' . esc_attr( $section['icon'] ) . '"' : '';
echo PHP_EOL;
echo '<div class="sections-container" id="' . esc_attr( 'sections-' . $section['slug'] ) . '" title="' . esc_attr( ucfirst( __( $section['title'] ) ) ) . '" ' . $icon . '>';
if ( ! empty( $section['view_file'] ) ) :
$view_file = FA_MNE_PLUGIN_DIR . '/modules/settings-page/views/' . basename( $section['view_file'] );
if ( file_exists( $view_file ) ) {
include_once $view_file;
}
endif;
if ( ! empty( $section['html'] ) ) {
echo esc_html( $section['html'] );
}
echo '</div>';
echo PHP_EOL;
}
}
/**
* Enqueue scripts
*
* @param mixed $hook
* @return void
*/
public function enqueue_scripts( $hook ) {
wp_enqueue_style(
'famne-settings-page',
plugins_url( '/modules/settings-page/assets/main.min.css', FA_MNE_PLUGIN_BASENAME ),
null,
time()
);
wp_enqueue_script(
'famne-settings-page',
plugins_url( '/modules/settings-page/assets/main.min.js', FA_MNE_PLUGIN_BASENAME ),
array( 'jquery' ),
time(),
true
);
}
/**
* Add_ plugin settings link
*
* @param mixed $links
* @return string
*/
public function add_action_links( $links ) {
$mylinks = array(
'<a href="' . admin_url( 'options-general.php?page=famne-admin' ) . '">' . __( 'Settings' ) . '</a>',
);
return array_merge( $links, $mylinks );
}
/**
* Translations.
*
* @since 1.4.2
*/
public function famne_load_textdomain() {
load_plugin_textdomain( FA_MNE_SLUG, false, basename( FA_MNE_PLUGIN_DIR ) . '/languages' );
}
}
endif;

View File

@@ -0,0 +1,87 @@
<?php
/**
* Form fields.
*
* This file is part of the Manage Notification Emails plugin
* You can find out more about this plugin at https://www.freeamigos.nl
* Copyright (c) 2006-2015 Virgial Berveling
*
* @package WordPress
* @author Virgial Berveling
* @copyright 2006-2015
*
* since: 1.3.0
*/
if ( ! defined( 'ABSPATH' ) || ! class_exists( 'FAMNESettingsPage', false ) ) {
exit;
}
/**
* Print start_table_form.
*
* @return void
*/
function print_start_table_form() {
?>
<table class="form-table"><tbody>
<?php
}
/**
* Print end_table_form.
*
* @return void
*/
function print_end_table_form() {
?>
</tbody></table>
<?php
}
/**
* Print checkbox.
*
* @param mixed $options
* @param mixed $id
* @param mixed $title
* @param mixed $label
* @param mixed $message
* @return void
*/
function print_checkbox( $options, $id, $title, $label = '', $message = '' ) {
$checked = isset( $options[ $id ] ) && '1' === strval( $options[ $id ] ) ? true : false;
print '<div class="option-container ' . ( $checked ? 'active' : '' ) . '">';
print '<label><input type="checkbox" name="famne_options[' . $id . ']" value="1" ' . ( $checked ? 'checked="checked"' : '' ) . ' class="checkbox-change"/>';
print '<strong>' . $title . '</strong><br/>' . $label;
print '</label>';
print '<p class="description">' . $message . '</p>';
print '</div>';
}
/**
* Print textbox.
*
* @param mixed $options
* @param mixed $id
* @param mixed $title
* @param mixed $label
* @param mixed $message
* @param mixed $type
* @param mixed $placeholder
* @return void
*/
function print_textbox( $options, $id, $title, $label = '', $message = '', $type = 'text', $placeholder = '' ) {
$value = isset( $options[ $id ] ) && ! empty( $options[ $id ] ) ? $options[ $id ] : '';
print '<div class="text-container ' . ( ! empty( $value ) ? 'active' : '' ) . '">';
print '<br/><strong>' . $title . '</strong><br/>';
print '<label><input type="' . $type . '" name="famne_options[' . $id . ']" placeholder="' . $placeholder . '" value="' . esc_attr( $value ) . '" />';
print $label;
print '</label>';
print '<p class="description">' . $message . '</p>';
print '</div>';
}

View File

@@ -0,0 +1,41 @@
<?php
/**
* Manage notification emails settings page class
* *
* This file is part of the Manage Notification Emails plugin
* You can find out more about this plugin at https://www.freeamigos.nl
* Copyright (c) 2006-2015 Virgial Berveling
*
* @package WordPress
* @author Virgial Berveling
* @copyright 2006-2020
*
* since: 1.6.0
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Load module famne_settings_page
*
* @return void
*/
function load_mod_famne_settings_page() {
if ( is_admin() ) :
FAMNE::AddModule(
'settings_page',
array(
'name' => 'Settings page',
'version' => '1.0.0',
)
);
include_once FA_MNE_PLUGIN_DIR . '/modules/settings-page/class.FAMNESettingsPage.php';
new FAMNESettingsPage();
endif;
}
add_action( 'fa_mne_modules', 'load_mod_famne_settings_page' );

View File

@@ -0,0 +1,44 @@
<?php
/**
* Custom view
*
* This file is part of the Manage Notification Emails plugin
* You can find out more about this plugin at https://www.freeamigos.nl
* Copyright (c) 2006-2015 Virgial Berveling
*
* @package WordPress
* @author Virgial Berveling
* @copyright 2006-2015
*
* since: 1.8.0
*/
if ( ! defined( 'ABSPATH' ) || ! class_exists( 'FAMNESettingsPage', false ) ) {
exit;
}
?>
<div class="wrap">
<h2><?php _e( 'Manage the notification e-mails', 'manage-notification-emails' ); ?> <small><small><?php _e( 'version', 'manage-notification-emails' ); ?> <?php echo FA_MNE_VERSION; ?></small></small></h2>
<form method="post" action="edit.php?action=famnesavenetwork" enctype="multipart/form-data">
<?php
wp_nonce_field( 'famnenetwork_save', 'famnenetwork' );
_e( 'Manage your notification e-mail preferences below.', 'manage-notification-emails' );
?>
<br/>
<br/>
<div class="nav-tab-wrapper"></div>
<div class="spacer"></div>
<div class="sections-wrapper">
<?php
// This prints out all hidden setting fields.
settings_fields( 'famne_option_group' );
FAMNESettingsPage::print_sections();
?>
<?php submit_button(); ?>
</div>
<div class="clear"></div>
</form>
</div>
<?php
require_once dirname( __FILE__ ) . '/donatebox.php';

View File

@@ -0,0 +1,62 @@
<?php
/**
* Custom view
*
* This file is part of the Manage Notification Emails plugin
* You can find out more about this plugin at https://www.freeamigos.nl
* Copyright (c) 2006-2015 Virgial Berveling
*
* @package WordPress
* @author Virgial Berveling
* @copyright 2006-2015
*
* since: 1.3.0
*/
if ( ! defined( 'ABSPATH' ) || ! class_exists( 'FAMNESettingsPage', false ) ) {
exit;
}
$managed_by_network = ! empty( FAMNE::get_option( 'famne_network_managed' ) );
?>
<div class="wrap">
<h2><?php _e( 'Manage the notification e-mails', 'manage-notification-emails' ); ?> <small><small><?php _e( 'version', 'manage-notification-emails' ); ?> <?php echo FA_MNE_VERSION; ?></small></small></h2>
<?php
if ( $managed_by_network ) :
?>
<div class="spacer"></div>
<div class="section-part network" style="text-align:center">
<div style="text-align:center;height:60px;padding-top:20px;padding-right:50px"><span class="dashicons dashicons-admin-multisite" style="font-size:50px"></span></div>
<h3 class="title" style="color:#76d450"><?php _e( 'Site managed by network manager', 'manage-notification-emails' ); ?></h3>
<?php _e( 'Manage notification e-mails settings for this site are globally managed in the multisite network settings menu.', 'manage-notification-emails' ); ?>
<div class="spacer"></div>
</div>
<div class="spacer"></div>
<?php
else :
_e( 'Manage your notification e-mail preferences below.', 'manage-notification-emails' );
?>
<form method="post" action="options.php?" enctype="multipart/form-data">
<br/>
<br/>
<div class="nav-tab-wrapper"></div>
<div class="spacer"></div>
<div class="sections-wrapper">
<?php
// This prints out all hidden setting fields.
settings_fields( 'famne_option_group' );
FAMNESettingsPage::print_sections();
?>
<?php submit_button(); ?>
</div>
<div class="clear"></div>
</form>
<?php
endif;
?>
</div>
<?php
if ( ! $managed_by_network ) :
require_once dirname( __FILE__ ) . '/donatebox.php';
endif;

View File

@@ -0,0 +1,26 @@
<?php
/**
* Custom view
*
* This file is part of the Manage Notification Emails plugin
* You can find out more about this plugin at https://www.freeamigos.nl
* Copyright (c) 2006-2015 Virgial Berveling
*
* @package WordPress
* @author Virgial Berveling
* @copyright 2006-2015
*
* since: 1.3.0
*/
?>
<div class="donation-box">
<p class="description"><?php _e( 'If you find this plugin useful, you can show your appreciation here :-)', 'manage-notification-emails' ); ?></p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick"/>
<input type="hidden" name="hosted_button_id" value="LTZWTLEDPULFE"/>
<input type="image" src="https://www.paypalobjects.com/nl_NL/NL/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal"/>
<img alt="" border="0" src="https://www.paypalobjects.com/nl_NL/i/scr/pixel.gif" width="1" height="1"/>
</form>
</div>
<div class="clear"></div>

View File

@@ -0,0 +1,36 @@
<?php
/**
* Custom view
*
* This file is part of the Manage Notification Emails plugin
* You can find out more about this plugin at https://www.freeamigos.nl
* Copyright (c) 2006-2015 Virgial Berveling
*
* @package WordPress
* @author Virgial Berveling
* @copyright 2006-2015
*
* since: 1.3.0
*/
if ( ! defined( 'ABSPATH' ) || ! class_exists( 'FAMNE', false ) ) {
exit;
}
global $famne_options;
?>
<div class="wrap page-width">
<h3><?php _e( 'Information', 'manage-notification-emails' ); ?></h3>
<div class="section-part extra">
<h3><?php _e( 'Available Manage Notification E-mail Modules', 'manage-notification-emails' ); ?></h3>
<ul>
<?php
$modules = FAMNE::getModules();
foreach ( $modules as $module ) :
$icon = $module->licensed ? 'dashicons-products"' : 'dashicons-admin-plugins';
?>
<li><span class="dashicons-before <?php echo $icon; ?>"></span><?php echo esc_html( $module->name ); ?> (<?php echo esc_html( $module->version ); ?>)</li>
<?php endforeach; ?>
</ul>
</div>
</div>

View File

@@ -0,0 +1,45 @@
<?php
/**
* Custom view
*
* This file is part of the Manage Notification Emails plugin
* You can find out more about this plugin at https://www.freeamigos.nl
* Copyright (c) 2006-2015 Virgial Berveling
*
* @package WordPress
* @author Virgial Berveling
* @copyright 2006-2015
*
* since: 1.3.0
*/
if ( ! defined( 'ABSPATH' ) || ! class_exists( 'FAMNESettingsPage', false ) ) {
exit;
}
global $famne_options;
?>
<div class="wrap">
<h3><?php _e( 'Extra modules', 'manage-notification-emails' ); ?></h3>
<p><?php _e( 'The modules below are options which are not available in WordPress by default.', 'manage-notification-emails' ); ?></p>
<div class="spacer"></div>
<div class="modules">
<?php
foreach ( FAMNE::getModules() as $mod ) :
if ( ! in_array( $mod->slug, array( 'pluggable', 'settings_page' ), true ) && ! empty( $mod->card ) ) {
call_user_func( $mod->card, $famne_options );
}
endforeach;
if ( current_user_can( 'manage_network_options' ) ) :
?>
<div class="card" style="text-align:center">
<div style="text-align:center;height:60px;padding-top:20px;padding-right:50px"><span class="dashicons dashicons-admin-multisite" style="font-size:50px"></span></div>
<h3 class="title" style="color:#76d450"><?php _e( 'Multisite managed settings available', 'manage-notification-emails' ); ?></h3>
<?php _e( 'For this environment, it is possible for you to manage all settings globally in the network settings menu.', 'manage-notification-emails' ); ?>
<div class="spacer"></div>
</div>
<?php endif; ?>
</div>
</div>

View File

@@ -0,0 +1,36 @@
<?php
/**
* Custom view
*
* This file is part of the Manage Notification Emails plugin
* You can find out more about this plugin at https://www.freeamigos.nl
* Copyright (c) 2006-2015 Virgial Berveling
*
* @package WordPress
* @author Virgial Berveling
* @copyright 2006-2015
*
* since: 1.8.0
*/
if ( ! defined( 'ABSPATH' ) || ! class_exists( 'FAMNESettingsPage', false ) ) {
exit;
}
$famne_options = FAMNE::get_option( 'famne_options' );
if ( is_array( $famne_options ) ) :
$famne_options = array();
endif;
$famne_options['network_managed'] = FAMNE::get_option( 'famne_network_managed' );
?>
<div class="wrap page-width">
<h3><?php _e( 'Manage multisite options', 'manage-notification-emails' ); ?></h3>
<p><?php _e( 'Here you can choose to manage all options for this plugin in one location. No hassle with toggling options on and off for each subsite individually.', 'manage-notification-emails' ); ?></p>
<div class="section-part">
<?php
print_checkbox( $famne_options, 'network_managed', __( 'Use the network settings.', 'manage-notification-emails' ), __( 'Checking this option will disable per site management. All sites will use these global network settings.', 'manage-notification-emails' ) );
?>
</div>
</div>

View File

@@ -0,0 +1,79 @@
<?php
/**
* Custom view
*
* This file is part of the Manage Notification Emails plugin
* You can find out more about this plugin at https://www.freeamigos.nl
* Copyright (c) 2006-2015 Virgial Berveling
*
* @package WordPress
* @author Virgial Berveling
* @copyright 2006-2015
*
* since: 1.3.0
* version: 1.3.1
*/
if ( ! defined( 'ABSPATH' ) || ! class_exists( 'FAMNESettingsPage', false ) ) {
exit;
}
global $famne_options;
?>
<div class="wrap page-width">
<h3><?php _e( 'Options for e-mails to users', 'manage-notification-emails' ); ?></h3>
<div class="section-part">
<?php
print_checkbox( $famne_options, 'wp_new_user_notification_to_user', __( 'New user notification to user', 'manage-notification-emails' ), __( 'Send e-mail with login credentials to a newly-registered user.', 'manage-notification-emails' ) );
print_checkbox( $famne_options, 'wp_notify_postauthor', __( 'Notify post author', 'manage-notification-emails' ), __( 'Send e-mail to an author (and/or others) of a comment/trackback/pingback on a post.', 'manage-notification-emails' ) );
print_checkbox( $famne_options, 'wp_notify_moderator', __( 'Notify moderator', 'manage-notification-emails' ), __( 'Send e-mail to the moderator of the blog about a new comment that is awaiting approval.', 'manage-notification-emails' ) );
print_checkbox( $famne_options, 'send_password_change_email', __( 'Password change notification to user', 'manage-notification-emails' ), __( 'Send e-mail to registered user about changing his or her password. Be careful with this option, because when unchecked, the forgotten password request e-mails will be blocked too.', 'manage-notification-emails' ) );
print_checkbox( $famne_options, 'send_email_change_email', __( 'E-mail address change notification to user', 'manage-notification-emails' ), __( 'Send e-mail to registered user about changing his or her E-mail address.', 'manage-notification-emails' ) );
print_checkbox( $famne_options, 'send_password_forgotten_email', __( 'Password forgotten e-mail to user', 'manage-notification-emails' ), __( 'Send the forgotten password e-mail to registered user.<br/>(To prevent locking yourself out, sending of the forgotten password e-mail for administrators will still work)', 'manage-notification-emails' ) );
?>
</div>
<br/>
<h2><?php _e( 'Options for e-mails to administrators', 'manage-notification-emails' ); ?></h2>
<div class="section-part">
<?php
print_start_table_form();
$user_noti_title = __( 'New user notification to site admin', 'manage-notification-emails' );
$user_noti_label = __( 'Sends an e-mail to the site admin after a new user is registered.', 'manage-notification-emails' );
if ( is_multisite() && ! FAMNE::network_managed() ) {
$user_noti = get_site_option( 'registrationnotification' ) === 'yes' ? true : false;
print '<div class="option-container">';
print '<label><input type="checkbox" disabled ' . ( $user_noti ? 'checked="checked"' : '' ) . ' />';
// translators: Adding network settings link.
print '<strong>' . $user_noti_title . '</strong><br/><em>' . sprintf( __( 'Globally managed in the multisite %1$snetwork settings menu%2$s.', 'manage-notification-emails' ), '<a href="' . network_admin_url( 'settings.php' ) . '">', '</a>' ) . '</em><br/>' . $user_noti_label;
print '</label>';
print '</div>';
} else {
print_checkbox( $famne_options, 'wp_new_user_notification_to_admin', $user_noti_title, $user_noti_label );
}
print_checkbox( $famne_options, 'wp_password_change_notification', __( 'Password change notification to admin', 'manage-notification-emails' ), __( 'Send e-mail to the blog admin of a user changing his or her password.', 'manage-notification-emails' ) );
print_checkbox( $famne_options, 'auto_core_update_send_email', __( 'Automatic WordPress core update e-mail', 'manage-notification-emails' ), __( 'Sends an e-mail after a successful automatic WordPress core update to administrators. E-mails about failed updates will always be sent to the administrators and cannot be disabled.', 'manage-notification-emails' ) );
print_checkbox( $famne_options, 'auto_plugin_update_send_email', __( 'Automatic WordPress plugin update e-mail', 'manage-notification-emails' ), __( 'Sends an e-mail after a successful automatic plugin update to administrators. E-mails about failed plugin updates will always be sent to the administrators', 'manage-notification-emails' ) );
print_checkbox( $famne_options, 'auto_theme_update_send_email', __( 'Automatic WordPress theme update e-mail', 'manage-notification-emails' ), __( 'Sends an e-mail after a successful automatic theme update to administrators. E-mails about failed theme updates will always be sent to the administrators', 'manage-notification-emails' ) );
print_end_table_form();
?>
</div>
<div class="section-part border-warning">
<?php
print_start_table_form();
print_checkbox( $famne_options, 'send_password_admin_forgotten_email', __( 'Password forgotten e-mail to administrator', 'manage-notification-emails' ), __( 'Send the forgotten password e-mail to administrators.', 'manage-notification-emails' ), __( 'Okay, this is a <strong style="color:#900">DANGEROUS OPTION !</strong><br/> So be warned, because unchecking this option prevents sending out the forgotten password e-mail to all administrators. So hold on to your own password and uncheck this one at your own risk ;-)', 'manage-notification-emails' ) );
print_end_table_form();
?>
</div>
<p style="float:right"><a href="#" onclick="resetToDefaults();return false" class="button"><?php _e( 'Reset settings', 'manage-notification-emails' ); ?></a></p>
</div>
<?php
$admin_page = FAMNESettingsPage::is_famne_network_settings_page() ? 'network/settings.php?page=famne-network-admin&famne_reset=1' : 'options-general.php?page=famne-admin&famne_reset=1';
$reset_url = str_replace( '&amp;', '&', wp_nonce_url( admin_url( $admin_page ), 'famne_reset', 'nonce' ) ) . '#settings';
?>
<script>
function resetToDefaults(){
var r = confirm('reset to default settings?');
if (r == true) document.location='<?php echo $reset_url; ?>';
}
</script>