\u00a9 Maintenance 2022
<\/div>","class":"full-width","desc":""},"font_size":{"type":"number","name":"font_size","label":"Font Size","value":"14","class":"number_small","units":{"px":"px","pt":"pt","em":"em"},"unit_value":"px"},"color":{"type":"color","name":"text_color","label":"Color","value":"rgba(255,255,255,1)","desc":""},"font":{"type":"font","name":"font","label":"Font","value":"Arial","class":"full-width","desc":""},"line_height":{"type":"number","name":"line_height","label":"Line Height","value":"1","units":{"px":"px","percent":"%","em":"em"},"unit_value":"em","class":"number_small","desc":""}}},"layout":{"name":"Layout","fields":{"padding_label":{"type":"label","name":"padding_label","label":"Padding"},"padding_top":{"type":"number","name":"padding_top","label":"Top","image_label":"MTNCURL\/img\/icons\/padding_top.png","value":"10","class":"number_small","units":{"px":"px","percent":"%","em":"em"},"unit_value":"px","wrapper_class":"col-4"},"padding_bottom":{"type":"number","name":"padding_bottom","label":"Bottom","image_label":"MTNCURL\/img\/icons\/padding_bottom.png","value":"10","class":"number_small","units":{"px":"px","percent":"%","em":"em"},"unit_value":"px","wrapper_class":"col-4"},"padding_left":{"type":"number","name":"padding_left","label":"Left","image_label":"MTNCURL\/img\/icons\/padding_left.png","value":"0","class":"number_small","units":{"px":"px","percent":"%","em":"em"},"unit_value":"px","wrapper_class":"col-4"},"padding_right":{"type":"number","name":"padding_right","label":"Right","image_label":"MTNCURL\/img\/icons\/padding_right.png","value":"0","class":"number_small","units":{"px":"px","percent":"%","em":"em"},"unit_value":"px","wrapper_class":"col-4"},"margin_label":{"type":"label","name":"margin_label","label":"Margin"},"margin_top":{"type":"number","name":"margin_top","label":"Top","image_label":"MTNCURL\/img\/icons\/margin_top.png","value":"0","class":"number_small","units":{"px":"px","percent":"%","em":"em"},"unit_value":"px","wrapper_class":"col-4"},"margin_bottom":{"type":"number","name":"margin_bottom","label":"Bottom","image_label":"MTNCURL\/img\/icons\/margin_bottom.png","value":"0","class":"number_small","units":{"px":"px","percent":"%","em":"em"},"unit_value":"px","wrapper_class":"col-4"},"margin_left":{"type":"number","name":"margin_left","label":"Left","image_label":"MTNCURL\/img\/icons\/margin_left.png","value":"0","class":"number_small","units":{"px":"px","percent":"%","em":"em"},"unit_value":"px","wrapper_class":"col-4"},"margin_right":{"type":"number","name":"margin_right","label":"Right","image_label":"MTNCURL\/img\/icons\/margin_right.png","value":"0","class":"number_small","units":{"px":"px","percent":"%","em":"em"},"unit_value":"px","wrapper_class":"col-4"},"background_label":{"type":"label","name":"background_label","label":"Background"},"background_color":{"type":"color","name":"background_color","nolabel":true,"value":"rgba(255,255,255,0)","desc":""},"background":{"type":"image","name":"background","nolabel":true,"value":"","class":"","desc":""}}}}}},"modules_order":{"logo-ea1e7873":"logo-ea1e7873","header-4b5742b4":"header-4b5742b4","content-a60d7054":"content-a60d7054","footer-b527dd0c":"footer-b527dd0c"},"name":"My Theme","body_font_size":"16","body_font_color":"#FFFFFF","body_font":"Orbitron","body_link_color":"#0096FF","body_link_hover_color":"#57BAFF","background_type":"image","background_video":"","background_video_fallback":"","background_video_filter":"","background_size_opt":"cover","background_position":"center center","background_image_filter":"","background_image":"","background_color":"rgba(64,64,64,1)","content_overlay":"","content_width":600,"content_overlay_color":"rgba(0,0,0,0.2)","content_overlay_shadow_color":"rgba(0,0,0,0)","content_position":"middle","modules_spacing":10,"custom_css":"","theme_thumbnail":"","theme_status":"","background_blur":10,"preloader_background_image":""}');
$logo_src = wp_get_attachment_image_src($mtnc_free_options['logo'], 'full');
$options['options']['themes'][$default_theme_id]->modules->{'logo-ea1e7873'}->groups->logo->fields->logo->value = esc_url($logo_src[0]);
$options['options']['themes'][$default_theme_id]->modules->{'logo-ea1e7873'}->groups->logo->fields->width->value = $mtnc_free_options['logo_width'];
$options['options']['themes'][$default_theme_id]->modules->{'logo-ea1e7873'}->groups->logo->fields->height->value = $mtnc_free_options['logo_height'];
//SEO
$options['options']['title'] = $mtnc_free_options['page_title'];
$options['options']['description'] = $mtnc_free_options['description'];
//Access
$options['options']['login_button'] = $mtnc_free_options['is_login'];
//Design
$old_bg = wp_get_attachment_image_src($mtnc_free_options['body_bg'], 'full');
$options['options']['themes'][$default_theme_id]->background_image = esc_url($old_bg[0]);
$options['options']['themes'][$default_theme_id]->background_blur = $mtnc_free_options['blur_intensity'];
$options['options']['themes'][$default_theme_id]->background_color = $mtnc_free_options['body_bg_color'];
$options['options']['themes'][$default_theme_id]->login_background_color = $mtnc_free_options['controls_bg_color'];
$options['options']['themes'][$default_theme_id]->body_font_color = $mtnc_free_options['font_color'];
$options['options']['themes'][$default_theme_id]->body_font = $mtnc_free_options['body_font_family'];
$options['options']['themes'][$default_theme_id]->background_color = $mtnc_free_options['body_bg_color'];
$options['options']['themes'][$default_theme_id]->custom_css = 'body,h2{font-weight:300;}';
$options['options']['themes'][$default_theme_id]->modules->{'header-4b5742b4'}->groups->header->fields->text->value = '
' . $mtnc_free_options['heading'] . ' ';
$options['options']['themes'][$default_theme_id]->modules->{'header-4b5742b4'}->groups->header->fields->font_size->value = 45;
$options['options']['themes'][$default_theme_id]->modules->{'header-4b5742b4'}->groups->header->fields->font->value = $mtnc_free_options['body_font_family'];
$options['options']['themes'][$default_theme_id]->modules->{'header-4b5742b4'}->groups->layout->fields->margin_top->value = 80;
$options['options']['themes'][$default_theme_id]->modules->{'content-a60d7054'}->groups->col1->fields->text->value = '
' . $mtnc_free_options['description'] . ' ';
$options['options']['themes'][$default_theme_id]->modules->{'content-a60d7054'}->groups->col1->fields->font_size->value = 16;
$options['options']['themes'][$default_theme_id]->modules->{'content-a60d7054'}->groups->col1->fields->font->value = $mtnc_free_options['body_font_family'];
$options['options']['themes'][$default_theme_id]->modules->{'content-a60d7054'}->groups->layout->fields->margin_bottom->value = 80;
$options['options']['themes'][$default_theme_id]->modules->{'footer-b527dd0c'}->groups->col1->fields->text->value = '
' . $mtnc_free_options['footer_text'] . ' ';
$options['options']['themes'][$default_theme_id]->modules->{'footer-b527dd0c'}->groups->col1->fields->font_size->value = 16;
$options['options']['themes'][$default_theme_id]->modules->{'footer-b527dd0c'}->groups->col1->fields->font->value = $mtnc_free_options['body_font_family'];
$options['upgraded'] = time();
$change = true;
}
if ($change) {
update_option('mtnc-options', $options, true);
}
$this->options = $options;
return $options;
} // load_options
// change status via admin bar
public function change_status()
{
check_admin_referer('mtnc_change_status');
if (empty($_GET['new_status'])) {
wp_safe_redirect(admin_url());
exit;
}
$options = $this->get_options();
if ($_GET['new_status'] == 'enabled') {
$options['status'] = '1';
} else {
$options['status'] = '0';
}
$this->update_options('options', $options);
if (!empty($_GET['redirect'])) {
wp_safe_redirect(wp_unslash($_GET['redirect']));
} else {
wp_safe_redirect(admin_url());
}
exit;
} // change_status
/**
* Dismiss notice via AJAX call
*
* @return null
*/
function ajax_dismiss_notice()
{
check_ajax_referer('maintenance_dismiss_notice');
if (!current_user_can('manage_options')) {
wp_send_json_error('You are not allowed to run this action.');
}
$notice_name = trim(sanitize_text_field(wp_unslash($_GET['notice_name'] ?? '')));
if (!$this->dismiss_notice($notice_name)) {
wp_send_json_error('Notice is already dismissed.');
} else {
wp_send_json_success();
}
} // ajax_dismiss_notice
/**
* Dismiss notice by adding it to dismissed_notices options array
*
* @param string $notice_name Notice to dismiss.
*
* @return bool
*/
function dismiss_notice($notice_name)
{
if ($this->get_dismissed_notices($notice_name)) {
return false;
} else {
$notices = $this->get_dismissed_notices();
$notices[$notice_name] = true;
$this->update_options('dismissed_notices', $notices);
return true;
}
} // dismiss_notice
/**
* Get all dismissed notices, or check for one specific notice
*
* @param string $notice_name Optional. Check if specified notice is dismissed.
*
* @return bool|array
*/
function get_dismissed_notices($notice_name = '')
{
$notices = $this->options['dismissed_notices'];
if (empty($notice_name)) {
return $notices;
} else {
if (empty($notices[$notice_name])) {
return false;
} else {
return true;
}
}
} // get_dismissed_notices
/**
* Retrieve available modules
*
* @return array
*/
public function get_modules()
{
$modules = array();
$modules['logo'] = array('name' => 'Logo', 'pro' => false);
$modules['header'] = array('name' => 'Header', 'pro' => false);
$modules['footer'] = array('name' => 'Footer', 'pro' => false);
$modules['content'] = array('name' => 'Content', 'pro' => false);
$modules['content2col'] = array('name' => 'Content 2 Column', 'pro' => true);
$modules['content3col'] = array('name' => 'Content 3 Column', 'pro' => true);
$modules['form'] = array('name' => 'Form', 'pro' => true);
$modules['video'] = array('name' => 'Video', 'pro' => true);
$modules['countdown'] = array('name' => 'Countdown', 'pro' => true);
$modules['progressbar'] = array('name' => 'Progress Bar', 'pro' => true);
$modules['social'] = array('name' => 'Social Icons', 'pro' => true);
$modules['map'] = array('name' => 'Map', 'pro' => true);
$modules['html'] = array('name' => 'Custom HTML', 'pro' => true);
$modules['divider'] = array('name' => 'Divider', 'pro' => true);
$modules = apply_filters('mtnc_modules_list', $modules);
return $modules;
}
/**
* Get meta part of plugin options
*
* @return array
*/
public function get_meta()
{
return $this->options['meta'];
} // get_meta
public function get_fonts()
{
$fonts = array('Arial', 'Helvetica', 'Georgia', 'Times New Roman', 'Tahoma', 'Verdana', 'Geneva', 'ABeeZee', 'Abel', 'Abhaya Libre', 'Abril Fatface', 'Aclonica', 'Acme', 'Actor', 'Adamina', 'Advent Pro', 'Aguafina Script', 'Akronim', 'Aladin', 'Aldrich', 'Alef', 'Alegreya', 'Alegreya SC', 'Alegreya Sans', 'Alegreya Sans SC', 'Alex Brush', 'Alfa Slab One', 'Alice', 'Alike', 'Alike Angular', 'Allan', 'Allerta', 'Allerta Stencil', 'Allura', 'Almendra', 'Almendra Display', 'Almendra SC', 'Amarante', 'Amaranth', 'Amatic SC', 'Amethysta', 'Amiko', 'Amiri', 'Amita', 'Anaheim', 'Andada', 'Andika', 'Angkor', 'Annie Use Your Telescope', 'Anonymous Pro', 'Antic', 'Antic Didone', 'Antic Slab', 'Anton', 'Arapey', 'Arbutus', 'Arbutus Slab', 'Architects Daughter', 'Archivo', 'Archivo Black', 'Archivo Narrow', 'Aref Ruqaa', 'Arima Madurai', 'Arimo', 'Arizonia', 'Armata', 'Arsenal', 'Artifika', 'Arvo', 'Arya', 'Asap', 'Asap Condensed', 'Asar', 'Asset', 'Assistant', 'Astloch', 'Asul', 'Athiti', 'Atma', 'Atomic Age', 'Aubrey', 'Audiowide', 'Autour One', 'Average', 'Average Sans', 'Averia Gruesa Libre', 'Averia Libre', 'Averia Sans Libre', 'Averia Serif Libre', 'Bad Script', 'Bahiana', 'Baloo', 'Baloo Bhai', 'Baloo Bhaijaan', 'Baloo Bhaina', 'Baloo Chettan', 'Baloo Da', 'Baloo Paaji', 'Baloo Tamma', 'Baloo Tammudu', 'Baloo Thambi', 'Balthazar', 'Bangers', 'Barlow', 'Barlow Condensed', 'Barlow Semi Condensed', 'Barrio', 'Basic', 'Battambang', 'Baumans', 'Bayon', 'Belgrano', 'Bellefair', 'Belleza', 'BenchNine', 'Bentham', 'Berkshire Swash', 'Bevan', 'Bigelow Rules', 'Bigshot One', 'Bilbo', 'Bilbo Swash Caps', 'BioRhyme', 'BioRhyme Expanded', 'Biryani', 'Bitter', 'Black Ops One', 'Bokor', 'Bonbon', 'Boogaloo', 'Bowlby One', 'Bowlby One SC', 'Brawler', 'Bree Serif', 'Bubblegum Sans', 'Bubbler One', 'Buda', 'Buenard', 'Bungee', 'Bungee Hairline', 'Bungee Inline', 'Bungee Outline', 'Bungee Shade', 'Butcherman', 'Butterfly Kids', 'Cabin', 'Cabin Condensed', 'Cabin Sketch', 'Caesar Dressing', 'Cagliostro', 'Cairo', 'Calligraffitti', 'Cambay', 'Cambo', 'Candal', 'Cantarell', 'Cantata One', 'Cantora One', 'Capriola', 'Cardo', 'Carme', 'Carrois Gothic', 'Carrois Gothic SC', 'Carter One', 'Catamaran', 'Caudex', 'Caveat', 'Caveat Brush', 'Cedarville Cursive', 'Ceviche One', 'Changa', 'Changa One', 'Chango', 'Chathura', 'Chau Philomene One', 'Chela One', 'Chelsea Market', 'Chenla', 'Cherry Cream Soda', 'Cherry Swash', 'Chewy', 'Chicle', 'Chivo', 'Chonburi', 'Cinzel', 'Cinzel Decorative', 'Clicker Script', 'Coda', 'Coda Caption', 'Codystar', 'Coiny', 'Combo', 'Comfortaa', 'Maintenance', 'Concert One', 'Condiment', 'Content', 'Contrail One', 'Convergence', 'Cookie', 'Copse', 'Corben', 'Cormorant', 'Cormorant Garamond', 'Cormorant Infant', 'Cormorant SC', 'Cormorant Unicase', 'Cormorant Upright', 'Courgette', 'Cousine', 'Coustard', 'Covered By Your Grace', 'Crafty Girls', 'Creepster', 'Crete Round', 'Crimson Text', 'Croissant One', 'Crushed', 'Cuprum', 'Cutive', 'Cutive Mono', 'Damion', 'Dancing Script', 'Dangrek', 'David Libre', 'Dawning of a New Day', 'Days One', 'Dekko', 'Delius', 'Delius Swash Caps', 'Delius Unicase', 'Della Respira', 'Denk One', 'Devonshire', 'Dhurjati', 'Didact Gothic', 'Diplomata', 'Diplomata SC', 'Domine', 'Donegal One', 'Doppio One', 'Dorsa', 'Dosis', 'Dr Sugiyama', 'Duru Sans', 'Dynalight', 'EB Garamond', 'Eagle Lake', 'Eater', 'Economica', 'Eczar', 'El Messiri', 'Electrolize', 'Elsie', 'Elsie Swash Caps', 'Emblema One', 'Emilys Candy', 'Encode Sans', 'Encode Sans Condensed', 'Encode Sans Expanded', 'Encode Sans Semi Condensed', 'Encode Sans Semi Expanded', 'Engagement', 'Englebert', 'Enriqueta', 'Erica One', 'Esteban', 'Euphoria Script', 'Ewert', 'Exo', 'Exo 2', 'Expletus Sans', 'Fanwood Text', 'Farsan', 'Fascinate', 'Fascinate Inline', 'Faster One', 'Fasthand', 'Fauna One', 'Faustina', 'Federant', 'Federo', 'Felipa', 'Fenix', 'Finger Paint', 'Fira Mono', 'Fira Sans', 'Fira Sans Condensed', 'Fira Sans Extra Condensed', 'Fjalla One', 'Fjord One', 'Flamenco', 'Flavors', 'Fondamento', 'Fontdiner Swanky', 'Forum', 'Francois One', 'Frank Ruhl Libre', 'Freckle Face', 'Fredericka the Great', 'Fredoka One', 'Freehand', 'Fresca', 'Frijole', 'Fruktur', 'Fugaz One', 'GFS Didot', 'GFS Neohellenic', 'Gabriela', 'Gafata', 'Galada', 'Galdeano', 'Galindo', 'Gentium Basic', 'Gentium Book Basic', 'Geo', 'Geostar', 'Geostar Fill', 'Germania One', 'Gidugu', 'Gilda Display', 'Give You Glory', 'Glass Antiqua', 'Glegoo', 'Gloria Hallelujah', 'Goblin One', 'Gochi Hand', 'Gorditas', 'Goudy Bookletter 1911', 'Graduate', 'Grand Hotel', 'Gravitas One', 'Great Vibes', 'Griffy', 'Gruppo', 'Gudea', 'Gurajada', 'Habibi', 'Halant', 'Hammersmith One', 'Hanalei', 'Hanalei Fill', 'Handlee', 'Hanuman', 'Happy Monkey', 'Harmattan', 'Headland One', 'Heebo', 'Henny Penny', 'Herr Von Muellerhoff', 'Hind', 'Hind Guntur', 'Hind Madurai', 'Hind Siliguri', 'Hind Vadodara', 'Holtwood One SC', 'Homemade Apple', 'Homenaje', 'IBM Plex Mono', 'IBM Plex Sans', 'IBM Plex Sans Condensed', 'IBM Plex Serif', 'IM Fell DW Pica', 'IM Fell DW Pica SC', 'IM Fell Double Pica', 'IM Fell Double Pica SC', 'IM Fell English', 'IM Fell English SC', 'IM Fell French Canon', 'IM Fell French Canon SC', 'IM Fell Great Primer', 'IM Fell Great Primer SC', 'Iceberg', 'Iceland', 'Imprima', 'Inconsolata', 'Inder', 'Indie Flower', 'Inika', 'Inknut Antiqua', 'Irish Grover', 'Istok Web', 'Italiana', 'Italianno', 'Itim', 'Jacques Francois', 'Jacques Francois Shadow', 'Jaldi', 'Jim Nightshade', 'Jockey One', 'Jolly Lodger', 'Jomhuria', 'Josefin Sans', 'Josefin Slab', 'Joti One', 'Judson', 'Julee', 'Julius Sans One', 'Junge', 'Jura', 'Just Another Hand', 'Just Me Again Down Here', 'Kadwa', 'Kalam', 'Kameron', 'Kanit', 'Kantumruy', 'Karla', 'Karma', 'Katibeh', 'Kaushan Script', 'Kavivanar', 'Kavoon', 'Kdam Thmor', 'Keania One', 'Kelly Slab', 'Kenia', 'Khand', 'Khmer', 'Khula', 'Kite One', 'Knewave', 'Kotta One', 'Koulen', 'Kranky', 'Kreon', 'Kristi', 'Krona One', 'Kumar One', 'Kumar One Outline', 'Kurale', 'La Belle Aurore', 'Laila', 'Lakki Reddy', 'Lalezar', 'Lancelot', 'Lateef', 'Lato', 'League Script', 'Leckerli One', 'Ledger', 'Lekton', 'Lemon', 'Lemonada', 'Libre Barcode 128', 'Libre Barcode 128 Text', 'Libre Barcode 39', 'Libre Barcode 39 Extended', 'Libre Barcode 39 Extended Text', 'Libre Barcode 39 Text', 'Libre Baskerville', 'Libre Franklin', 'Life Savers', 'Lilita One', 'Lily Script One', 'Limelight', 'Linden Hill', 'Lobster', 'Lobster Two', 'Londrina Outline', 'Londrina Shadow', 'Londrina Sketch', 'Londrina Solid', 'Lora', 'Love Ya Like A Sister', 'Loved by the King', 'Lovers Quarrel', 'Luckiest Guy', 'Lusitana', 'Lustria', 'Macondo', 'Macondo Swash Caps', 'Mada', 'Magra', 'Maiden Orange', 'Maitree', 'Mako', 'Mallanna', 'Mandali', 'Manuale', 'Marcellus', 'Marcellus SC', 'Marck Script', 'Margarine', 'Marko One', 'Marmelad', 'Martel', 'Martel Sans', 'Marvel', 'Mate', 'Mate SC', 'Maven Pro', 'McLaren', 'Meddon', 'MedievalSharp', 'Medula One', 'Meera Inimai', 'Megrim', 'Meie Script', 'Merienda', 'Merienda One', 'Merriweather', 'Merriweather Sans', 'Metal', 'Metal Mania', 'Metamorphous', 'Metrophobic', 'Michroma', 'Milonga', 'Miltonian', 'Miltonian Tattoo', 'Mina', 'Miniver', 'Miriam Libre', 'Mirza', 'Miss Fajardose', 'Mitr', 'Modak', 'Modern Antiqua', 'Mogra', 'Molengo', 'Molle', 'Monda', 'Monofett', 'Monoton', 'Monsieur La Doulaise', 'Montaga', 'Montez', 'Montserrat', 'Montserrat Alternates', 'Montserrat Subrayada', 'Moul', 'Moulpali', 'Mountains of Christmas', 'Mouse Memoirs', 'Mr Bedfort', 'Mr Dafoe', 'Mr De Haviland', 'Mrs Saint Delafield', 'Mrs Sheppards', 'Mukta', 'Mukta Mahee', 'Mukta Malar', 'Mukta Vaani', 'Muli', 'Mystery Quest', 'NTR', 'Nanum Brush Script', 'Nanum Gothic', 'Nanum Gothic Coding', 'Nanum Myeongjo', 'Nanum Pen Script', 'Neucha', 'Neuton', 'New Rocker', 'News Cycle', 'Niconne', 'Nixie One', 'Nobile', 'Nokora', 'Norican', 'Nosifer', 'Nothing You Could Do', 'Noticia Text', 'Noto Sans', 'Noto Serif', 'Nova Cut', 'Nova Flat', 'Nova Mono', 'Nova Oval', 'Nova Round', 'Nova Script', 'Nova Slim', 'Nova Square', 'Numans', 'Nunito', 'Nunito Sans', 'Odor Mean Chey', 'Offside', 'Old Standard TT', 'Oldenburg', 'Oleo Script', 'Oleo Script Swash Caps', 'Open Sans', 'Open Sans Condensed', 'Oranienbaum', 'Orbitron', 'Oregano', 'Orienta', 'Original Surfer', 'Oswald', 'Over the Rainbow', 'Overlock', 'Overlock SC', 'Overpass', 'Overpass Mono', 'Ovo', 'Oxygen', 'Oxygen Mono', 'PT Mono', 'PT Sans', 'PT Sans Caption', 'PT Sans Narrow', 'PT Serif', 'PT Serif Caption', 'Pacifico', 'Padauk', 'Palanquin', 'Palanquin Dark', 'Pangolin', 'Paprika', 'Parisienne', 'Passero One', 'Passion One', 'Pathway Gothic One', 'Patrick Hand', 'Patrick Hand SC', 'Pattaya', 'Patua One', 'Pavanam', 'Paytone One', 'Peddana', 'Peralta', 'Permanent Marker', 'Petit Formal Script', 'Petrona', 'Philosopher', 'Piedra', 'Pinyon Script', 'Pirata One', 'Plaster', 'Play', 'Playball', 'Playfair Display', 'Playfair Display SC', 'Podkova', 'Poiret One', 'Poller One', 'Poly', 'Pompiere', 'Pontano Sans', 'Poppins', 'Port Lligat Sans', 'Port Lligat Slab', 'Pragati Narrow', 'Prata', 'Preahvihear', 'Press Start 2P', 'Pridi', 'Princess Sofia', 'Prociono', 'Prompt', 'Prosto One', 'Proza Libre', 'Puritan', 'Purple Purse', 'Quando', 'Quantico', 'Quattrocento', 'Quattrocento Sans', 'Questrial', 'Quicksand', 'Quintessential', 'Qwigley', 'Racing Sans One', 'Radley', 'Rajdhani', 'Rakkas', 'Raleway', 'Raleway Dots', 'Ramabhadra', 'Ramaraja', 'Rambla', 'Rammetto One', 'Ranchers', 'Rancho', 'Ranga', 'Rasa', 'Rationale', 'Ravi Prakash', 'Redressed', 'Reem Kufi', 'Reenie Beanie', 'Revalia', 'Rhodium Libre', 'Ribeye', 'Ribeye Marrow', 'Righteous', 'Risque', 'Roboto', 'Roboto Condensed', 'Roboto Mono', 'Roboto Slab', 'Rochester', 'Rock Salt', 'Rokkitt', 'Romanesco', 'Ropa Sans', 'Rosario', 'Rosarivo', 'Rouge Script', 'Rozha One', 'Rubik', 'Rubik Mono One', 'Ruda', 'Rufina', 'Ruge Boogie', 'Ruluko', 'Rum Raisin', 'Ruslan Display', 'Russo One', 'Ruthie', 'Rye', 'Sacramento', 'Sahitya', 'Sail', 'Saira', 'Saira Condensed', 'Saira Extra Condensed', 'Saira Semi Condensed', 'Salsa', 'Sanchez', 'Sancreek', 'Sansita', 'Sarala', 'Sarina', 'Sarpanch', 'Satisfy', 'Scada', 'Scheherazade', 'Schoolbell', 'Scope One', 'Seaweed Script', 'Secular One', 'Sedgwick Ave', 'Sedgwick Ave Display', 'Sevillana', 'Seymour One', 'Shadows Into Light', 'Shadows Into Light Two', 'Shanti', 'Share', 'Share Tech', 'Share Tech Mono', 'Shojumaru', 'Short Stack', 'Shrikhand', 'Siemreap', 'Sigmar One', 'Signika', 'Signika Negative', 'Simonetta', 'Sintony', 'Sirin Stencil', 'Six Caps', 'Skranji', 'Slabo 13px', 'Slabo 27px', 'Slackey', 'Smokum', 'Smythe', 'Sniglet', 'Snippet', 'Snowburst One', 'Sofadi One', 'Sofia', 'Sonsie One', 'Sorts Mill Goudy', 'Source Code Pro', 'Source Sans Pro', 'Source Serif Pro', 'Space Mono', 'Special Elite', 'Spectral', 'Spectral SC', 'Spicy Rice', 'Spinnaker', 'Spirax', 'Squada One', 'Sree Krushnadevaraya', 'Sriracha', 'Stalemate', 'Stalinist One', 'Stardos Stencil', 'Stint Ultra Condensed', 'Stint Ultra Expanded', 'Stoke', 'Strait', 'Sue Ellen Francisco', 'Suez One', 'Sumana', 'Sunshiney', 'Supermercado One', 'Sura', 'Suranna', 'Suravaram', 'Suwannaphum', 'Swanky and Moo Moo', 'Syncopate', 'Tangerine', 'Taprom', 'Tauri', 'Taviraj', 'Teko', 'Telex', 'Tenali Ramakrishna', 'Tenor Sans', 'Text Me One', 'The Girl Next Door', 'Tienne', 'Tillana', 'Timmana', 'Tinos', 'Titan One', 'Titillium Web', 'Trade Winds', 'Trirong', 'Trocchi', 'Trochut', 'Trykker', 'Tulpen One', 'Ubuntu', 'Ubuntu Condensed', 'Ubuntu Mono', 'Ultra', 'Uncial Antiqua', 'Underdog', 'Unica One', 'UnifrakturCook', 'UnifrakturMaguntia', 'Unkempt', 'Unlock', 'Unna', 'VT323', 'Vampiro One', 'Varela', 'Varela Round', 'Vast Shadow', 'Vesper Libre', 'Vibur', 'Vidaloka', 'Viga', 'Voces', 'Volkhov', 'Vollkorn', 'Vollkorn SC', 'Voltaire', 'Waiting for the Sunrise', 'Wallpoet', 'Walter Turncoat', 'Warnes', 'Wellfleet', 'Wendy One', 'Wire One', 'Work Sans', 'Yanone Kaffeesatz', 'Yantramanav', 'Yatra One', 'Yellowtail', 'Yeseva One', 'Yesteryear', 'Yrsa', 'Zeyada', 'Zilla Slab', 'Zilla Slab Highlight');
return $fonts;
}
/**
* Get options part of plugin options
*
* @return array
*/
public function get_options()
{
return $this->options['options'];
} // get_options
/**
* Get all plugin options
*
* @return array
*/
public function get_all_options()
{
return $this->options;
} // get_all_options
/**
* Update specified plugin options key
*
* @param string $key Data to save.
* @param string $data Option key.
*
* @return bool
*/
public function update_options($key, $data)
{
if (false === in_array($key, array('meta', 'dismissed_notices', 'options'))) {
user_error('Unknown options key.', E_USER_ERROR);
return false;
}
$this->options[$key] = $data;
$tmp = update_option('mtnc-options', $this->options);
return $tmp;
} // set_options
/**
* Add plugin menu entry under Tools menu
*
* @return null
*/
public function admin_menu()
{
add_menu_page('Maintenance', 'Maintenance', 'manage_options', 'maintenance', array($this, 'plugin_page'), $this->plugin_url . 'img/icon-small.png');
} // admin_menu
/**
* Returns all WP pointers
*
* @return array
*/
function get_pointers()
{
$pointers = array();
$pointers['welcome'] = array('target' => '#toplevel_page_maintenance', 'edge' => 'left', 'align' => 'right', 'content' => 'Thank you for installing the
Maintenance plugin!
Open
Maintenance to access Maintenance settings.');
return $pointers;
} // get_pointers
/**
* Enqueue CSS and JS files
*
* @return null
*/
public function admin_enqueue_scripts($hook)
{
$options = $this->get_options();
$pointers = $this->get_pointers();
$dismissed_notices = $this->get_dismissed_notices();
foreach ($dismissed_notices as $notice_name => $tmp) {
if ($tmp) {
unset($pointers[$notice_name]);
}
}
if (!empty($pointers) && !$this->is_plugin_page() && current_user_can('manage_options')) {
$pointers['_nonce_dismiss_pointer'] = wp_create_nonce('maintenance_dismiss_notice');
wp_enqueue_style('wp-pointer');
wp_enqueue_script('maintenance-pointers', $this->plugin_url . 'js/pointers.js', array('jquery'), $this->version, true);
wp_enqueue_script('wp-pointer');
wp_localize_script('wp-pointer', 'mtnc_pointers', $pointers);
}
if (!$this->is_plugin_page()) {
return;
}
$this->dismiss_notice('welcome');
$js_localize = array(
'undocumented_error' => esc_html__('An undocumented error has occurred. Please refresh the page and try again.', 'maintenance'),
'documented_error' => esc_html__('An error has occurred.', 'maintenance'),
'plugin_name' => 'Maintenance',
'url' => MTNC_URL,
'icon_url' => $this->plugin_url . 'img/loader-icon.png',
'nonce_action' => wp_create_nonce('mtnc_action'),
'theme_global' => $options['theme_global'],
'theme' => $this->theme,
'theme_id' => $this->theme_id,
'fonts' => $this->get_fonts(),
'max_upload_size' => wp_max_upload_size(),
'settings_url' => admin_url('admin.php?page=maintenance'),
'is_plugin_page' => $this->is_plugin_page(),
'wpfssl_install_url' => add_query_arg(
array(
'action' => 'mtnc_install_wpfssl',
'_wpnonce' => wp_create_nonce('install_wpfssl'),
'rnd' => wp_rand()
),
admin_url('admin.php')
),
'wpcaptcha_install_url' => add_query_arg(
array(
'action' => 'mtnc_install_wpcaptcha',
'_wpnonce' => wp_create_nonce('install_wpcaptcha'),
'rnd' => wp_rand()
),
admin_url('admin.php')
),
'weglot_install_url' => add_query_arg(
array(
'action' => 'mtnc_install_weglot',
'_wpnonce' => wp_create_nonce('install_weglot'),
'rnd' => wp_rand()
),
admin_url('admin.php')
),
'weglot_dialog_upsell_title' => '
',
);
if ($this->is_plugin_page()) {
wp_enqueue_style('maintenance-admin', $this->plugin_url . 'css/maintenance-admin.css', array(), $this->version);
wp_enqueue_script('jquery-ui-tabs');
wp_enqueue_script('jquery-ui-core');
wp_enqueue_script('jquery-ui-position');
wp_enqueue_script('jquery-ui-sortable');
wp_enqueue_script('jquery-ui-datepicker');
wp_enqueue_style('wp-jquery-ui-dialog');
wp_enqueue_script('jquery-ui-dialog');
wp_enqueue_style('maintenance-summernote', $this->plugin_url . 'css/summernote-lite.min.css', array(), $this->version);
wp_enqueue_script('maintenance-summernote', $this->plugin_url . 'js/summernote-lite.min.js', array('jquery'), $this->version, true); //WYSIWYG Module Editor
wp_enqueue_style('maintenance-fonticonpicker', $this->plugin_url . 'css/jquery.fonticonpicker.min.css', array(), $this->version);
wp_enqueue_style('maintenance-font-roboto', 'https://fonts.bunny.net/css2?family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap', array(), $this->version);
wp_enqueue_style('maintenance-material-icons', 'https://fonts.googleapis.com/icon?family=Material+Icons', array(), $this->version);
wp_enqueue_style('maintenance-sweetalert2', $this->plugin_url . 'css/sweetalert2.min.css', array(), $this->version);
wp_enqueue_style('maintenance-select2', $this->plugin_url . 'css/select2.css', array(), $this->version);
wp_enqueue_script('maintenance-sweetalert2', $this->plugin_url . 'js/maintenance-sweetalert2.min.js', array('jquery'), $this->version, true);
wp_enqueue_script('maintenance-select2', $this->plugin_url . 'js/select2.min.js', array('jquery'), $this->version, true);
wp_enqueue_script('maintenance-colorpicker', $this->plugin_url . 'js/colorpicker/jscolor.js', false, $this->version, true);
wp_enqueue_script('maintenance', $this->plugin_url . 'js/maintenance-admin.js', array('jquery'), $this->version, true);
wp_enqueue_script('maintenance-fonticonpicker', $this->plugin_url . 'js/jquery.fonticonpicker.min.js', array('jquery'), $this->version, true);
wp_enqueue_script('maintenance-ace-editor', $this->plugin_url . 'js/editor/ace.js', false, $this->version, true); // Custom CSS Editor
wp_enqueue_script('maintenance-webfonts', $this->plugin_url . 'js/webfont.js', false, $this->version, true); //Visual font picker preview
wp_localize_script('maintenance', 'mtnc', $js_localize);
wp_enqueue_media();
wp_dequeue_style('uiStyleSheet');
wp_dequeue_style('wpcufpnAdmin');
wp_dequeue_style('unifStyleSheet');
wp_dequeue_style('wpcufpn_codemirror');
wp_dequeue_style('wpcufpn_codemirrorTheme');
wp_dequeue_style('collapse-admin-css');
wp_dequeue_style('jquery-ui-css');
wp_dequeue_style('tribe-common-admin');
wp_dequeue_style('file-manager__jquery-ui-css');
wp_dequeue_style('file-manager__jquery-ui-css-theme');
wp_dequeue_style('wpmegmaps-jqueryui');
wp_dequeue_style('wp-botwatch-css');
}
} // admin_enqueue_scripts
function frontend_login()
{
global $wp_query, $error;
$mt_options = $this->get_options();
$user_connect = false;
if (!is_array($wp_query->query_vars)) {
$wp_query->query_vars = array();
}
$error_message = $user_login = $user_pass = $error = '';
$class_login = 'user-icon';
$class_password = 'pass-icon';
if (isset($_POST['is_custom_login'])) {
$user_login = '';
if (isset($_POST['log']) && wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['mtnc_login_check'] ?? '')), 'mtnc_login')) {
$user_login = sanitize_user(wp_unslash($_POST['log']));
}
$user_login = sanitize_user($user_login);
$user_pass = '';
if (isset($_POST['pwd']) && wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['mtnc_login_check'] ?? '')), 'mtnc_login')) {
$user_pass = trim(sanitize_text_field(wp_unslash($_POST['pwd'])));
}
$access = array();
$access['user_login'] = esc_attr($user_login);
$access['user_password'] = $user_pass;
$access['remember'] = true;
$user = null;
$user = new WP_User(0, $user_login);
if (is_ssl()) {
$ssl = true;
} else {
$ssl = false;
}
$user_connect = wp_signon($access, $ssl);
if (is_wp_error($user_connect)) {
if ($user_connect->get_error_code() === 'invalid_username') {
$error_message = esc_html__('Login is incorrect!', 'maintenance');
$class_login = 'error';
$class_password = 'error';
} elseif ($user_connect->get_error_code() === 'incorrect_password') {
$error_message = esc_html__('Password is incorrect!', 'maintenance');
$class_password = 'error';
} else {
$error_message = esc_html__('Login and password are incorrect!', 'maintenance');
$class_login = 'error';
$class_password = 'error';
}
} else {
wp_safe_redirect(home_url('/'));
exit;
}
}
return array($error_message, $class_login, $class_password, $user_login);
} // frontend_login
public function admin_bar_style()
{
$options = $this->get_options();
// admin bar has to be anabled, user an admin and custom filter true
if ($options['disable_toolbar_menu'] || false === is_admin_bar_showing() || false === current_user_can('manage_options')) {
return;
}
// no sense in loading a new CSS file for 2 lines of CSS
$custom_css = '';
self::wp_kses_wf($custom_css);
} // admin_bar_style
// add admin bar menu and status
public function admin_bar()
{
global $wp_admin_bar;
$options = $this->get_options();
// only show to admins
if ($options['disable_toolbar_menu'] || false === current_user_can('manage_options')) {
return;
}
$plugin_name = 'Maintenance';
$plugin_logo = MTNC_URL . '/img/icon-transparent.png';
$request_uri = sanitize_text_field(wp_unslash($_SERVER['REQUEST_URI'] ?? ''));
if ($options['status'] == '1') {
$main_label = '
' . $plugin_name . ' ● ';
$class = 'mtnc-enabled';
$action_url = add_query_arg(array('action' => 'mtnc_change_status', 'new_status' => 'disabled', 'redirect' => urlencode($request_uri)), admin_url('admin.php'));
$action_url = wp_nonce_url($action_url, 'mtnc_change_status');
$action = 'Maintenance mode';
$action .= '
OFF ON ';
} else {
$main_label = '
' . $plugin_name . ' ● ';
$class = 'mtnc-disabled';
$action_url = add_query_arg(array('action' => 'mtnc_change_status', 'new_status' => 'enabled', 'redirect' => urlencode($request_uri)), admin_url('admin.php'));
$action_url = wp_nonce_url($action_url, 'mtnc_change_status');
$action = 'Maintenance mode';
$action .= '
OFF ON ';
}
$wp_admin_bar->add_menu(array(
'parent' => '',
'id' => 'mtnc',
'title' => $main_label,
'href' => admin_url('admin.php?page=maintenance'),
'meta' => array('class' => $class),
));
$wp_admin_bar->add_node(array(
'id' => 'mtnc-status',
'title' => $action,
'href' => false,
'parent' => 'mtnc',
));
$wp_admin_bar->add_node(array(
'id' => 'mtnc-preview',
'title' => 'Preview',
'href' => home_url('/') . '?maintenance-preview',
'parent' => 'mtnc',
'meta' => array('target' => '_blank'),
));
$wp_admin_bar->add_node(array(
'id' => 'mtnc-settings',
'title' => 'Settings',
'href' => admin_url('admin.php?page=maintenance'),
'parent' => 'mtnc',
));
} // admin_bar
/**
* Perform an action via AJAX
*
* @return bool
*/
public function ajax_action()
{
check_ajax_referer('mtnc_action');
if (!current_user_can('manage_options')) {
wp_send_json_error(__('You are not allowed to run this action.', 'maintenance'));
}
$options = $this->get_options();
$action = trim(wp_unslash($_REQUEST['mtnc_action'] ?? '')); //phpcs:ignore
$extra_data = wp_unslash($_REQUEST['extra_data'] ?? ''); //phpcs:ignore
if (is_string($extra_data)) {
parse_str($extra_data, $extra_data);
} elseif (is_array($extra_data)) {
$extra_data = array_slice($extra_data, 0, 20);
} else {
$extra_data = false;
}
switch ($action) {
case 'save':
$new_options = array(
'theme_global' => $options['theme_global'],
'themes' => $options['themes'],
'status' => @absint($extra_data['mtnc_status']),
'mode' => 'layout',
'mtnc_page' => 0,
//SEO
'title' => strip_tags($extra_data['title']),
'analytics' => strip_tags($this->convert_ga($extra_data['analytics'])),
//Access
'per_url_settings' => wp_strip_all_tags($extra_data['per_url_settings']),
'per_url_enable_disable' => wp_strip_all_tags($extra_data['per_url_enable_disable']),
'login_button' => @absint($extra_data['login_button']),
'wplogin_button_tooltip' => wp_strip_all_tags($extra_data['wplogin_button_tooltip']),
);
$new_options['theme_global'] = sanitize_text_field(wp_unslash($_REQUEST['theme_global'] ?? ''));
//theme JSON will get broken by sanitization through wp_kses_post or normal functions, fields will be escaped when rendering on front-end
$theme = $_REQUEST['theme']; //phpcs:ignore
$theme_id = sanitize_text_field(wp_unslash($_REQUEST['theme_id'] ?? ''));
$theme_new = sanitize_text_field(wp_unslash($_REQUEST['theme_new'] ?? ''));
$theme_name = sanitize_text_field(wp_unslash($_REQUEST['theme_name'] ?? ''));
if (isset($_REQUEST['theme_new']) && $theme_new == true) {
$theme_id = md5(time() . $theme_name);
}
$new_options['themes'][$theme_id] = json_decode(stripslashes($theme));
$new_options['themes'][$theme_id]->name = $theme_name;
//Design General
if (isset($extra_data['theme_thumbnail'])) {
$new_options['themes'][$theme_id]->theme_thumbnail = wp_strip_all_tags($extra_data['theme_thumbnail']);
}
if (isset($extra_data['theme_status'])) {
$new_options['themes'][$theme_id]->theme_status = wp_strip_all_tags($extra_data['theme_status']);
}
$new_options['themes'][$theme_id]->body_font_size = wp_strip_all_tags($extra_data['body_font_size']);
$new_options['themes'][$theme_id]->body_font_color = wp_strip_all_tags($extra_data['body_font_color']);
$new_options['themes'][$theme_id]->body_font = wp_strip_all_tags($extra_data['body_font']);
$new_options['themes'][$theme_id]->body_link_color = wp_strip_all_tags($extra_data['body_link_color']);
$new_options['themes'][$theme_id]->body_link_hover_color = wp_strip_all_tags($extra_data['body_link_hover_color']);
//Design General
$new_options['themes'][$theme_id]->background_type = wp_strip_all_tags($extra_data['background_type']);
$new_options['themes'][$theme_id]->background_video = wp_strip_all_tags($extra_data['background_video']);
$new_options['themes'][$theme_id]->background_video_fallback = isset($extra_data['background_video_fallback']) ? wp_strip_all_tags($extra_data['background_video_fallback']) : '';
$new_options['themes'][$theme_id]->background_video_filter = wp_strip_all_tags($extra_data['background_video_filter']);
$new_options['themes'][$theme_id]->background_size_opt = wp_strip_all_tags($extra_data['background_size_opt']);
$new_options['themes'][$theme_id]->background_position = wp_strip_all_tags($extra_data['background_position']);
$new_options['themes'][$theme_id]->background_image_filter = wp_strip_all_tags($extra_data['background_image_filter']);
$new_options['themes'][$theme_id]->background_image = wp_strip_all_tags($extra_data['background_image']);
$new_options['themes'][$theme_id]->background_blur = (int)$extra_data['background_blur'];
$new_options['themes'][$theme_id]->login_background_color = wp_strip_all_tags($extra_data['login_background_color']);
$new_options['themes'][$theme_id]->preloader_background_image = wp_strip_all_tags($extra_data['preloader_background_image']);
$new_options['themes'][$theme_id]->background_color = wp_strip_all_tags($extra_data['background_color']);
$new_options['themes'][$theme_id]->content_overlay = isset($extra_data['content_overlay']) ? wp_strip_all_tags($extra_data['content_overlay']) : '';
$new_options['themes'][$theme_id]->content_width = (int) $extra_data['content_width'];
$new_options['themes'][$theme_id]->content_overlay_color = wp_strip_all_tags($extra_data['content_overlay_color']);
$new_options['themes'][$theme_id]->content_overlay_shadow_color = wp_strip_all_tags($extra_data['content_overlay_shadow_color']);
$new_options['themes'][$theme_id]->content_position = wp_strip_all_tags($extra_data['content_position']);
$new_options['themes'][$theme_id]->modules_spacing = (int) $extra_data['modules_spacing'];
$new_options['themes'][$theme_id]->custom_css = wp_strip_all_tags($extra_data['custom_css']);
$this->update_options('options', $new_options);
wp_send_json_success(array('theme_id' => $theme_id, 'theme' => $new_options['themes'][$theme_id]));
break;
}
}
/**
* Test if we're on Maintenance's admin page
*
* @return bool
*/
public function is_plugin_page()
{
if (!function_exists('get_current_screen')) {
return false;
}
$current_screen = get_current_screen();
if (!empty($current_screen) && $current_screen->id == 'toplevel_page_maintenance') {
return true;
} else {
return false;
}
} // is_plugin_page
/**
* Main/starter function for displaying plugin's admin page
*
* @return null
*/
public function plugin_page()
{
$options = $this->get_options();
// double check for admin privileges
if (!current_user_can('manage_options')) {
wp_die(esc_html__('Sorry, you are not allowed to access this page.', 'maintenance'));
}
echo '
'; // wrap
self::wp_kses_wf($this->pro_dialog());
} // plugin_page
function is_weglot_active()
{
if (!function_exists('is_plugin_active') || !function_exists('get_plugin_data')) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
if (is_plugin_active('weglot/weglot.php')) {
$weglot_info = get_plugin_data(ABSPATH . 'wp-content/plugins/weglot/weglot.php');
if (version_compare($weglot_info['Version'], '2.5', '<')) {
return false;
} else {
return true;
}
} else {
return false;
}
} // mtcn_is_weglot_active
// check if Weglot is completely set up
function is_weglot_setup()
{
if (!$this->is_weglot_active()) {
return false;
}
$active_languages = weglot_get_destination_languages();
if (!empty($active_languages)) {
return true;
} else {
return false;
}
} // is_weglot_setup
function pro_dialog()
{
$out = '';
$out .= '
';
$out .= '
';
$out .= '
Limited PRO Discount - all prices are LIFETIME ! Pay once & use forever! ';
$out .= '
';
$out .= '
';
$out .= '';
$out .= 'Lifetime Personal License ';
$out .= 'Lifetime Team License ';
$out .= 'Lifetime Agency License ';
$out .= ' ';
$out .= '';
$out .= '$49 /year$69 /lifetime ';
$out .= '$89 /year$79 /lifetime ';
$out .= '$199 /year$119 /lifetime ';
$out .= ' ';
$out .= '';
$out .= '1 Site License ';
$out .= '5 Sites License ';
$out .= '100 Sites License ';
$out .= ' ';
$out .= '';
$out .= ' All Plugin Features ';
$out .= ' All Plugin Features ';
$out .= ' All Plugin Features ';
$out .= ' ';
$out .= '';
$out .= ' Lifetime Updates & Support ';
$out .= ' Lifetime Updates & Support ';
$out .= ' Lifetime Updates & Support ';
$out .= ' ';
$out .= '';
$out .= ' +200 Themes ';
$out .= ' +200 Themes ';
$out .= ' +200 Themes ';
$out .= ' ';
$out .= '';
$out .= ' +8.5 Million HD Images ';
$out .= ' +8.5 Million HD Images ';
$out .= ' +8.5 Million HD Images ';
$out .= ' ';
$out .= '';
$out .= ' 5 new themes each month guaranteed ';
$out .= ' 5 new themes each month guaranteed ';
$out .= ' 5 new themes each month guaranteed ';
$out .= ' ';
$out .= '';
$out .= ' Licenses & Sites Manager ';
$out .= ' Licenses & Sites Manager ';
$out .= ' Licenses & Sites Manager ';
$out .= ' ';
$out .= '';
$out .= ' White-label Mode ';
$out .= ' White-label Mode ';
$out .= ' White-label Mode ';
$out .= ' ';
$out .= '';
$out .= ' Full Plugin Rebranding ';
$out .= ' Full Plugin Rebranding ';
$out .= ' Full Plugin Rebranding ';
$out .= ' ';
$out .= '';
$out .= 'Lifetime License $69 -> BUY NOW ';
$out .= 'Lifetime License $79 -> BUY NOW ';
$out .= 'Lifetime License $119 -> BUY NOW ';
$out .= ' ';
$out .= '
';
$out .= '
';
// weglot install dialog
$out .= '
';
$out .= '
';
$out .= '
';
$out .= 'Best-rated WordPress multilingual plugin ';
$out .= 'Simple 5-minute set-up. No coding required ';
$out .= 'Accelerated translation management: AI powered & human translations with access to professional translators ';
$out .= 'Compatible with any WordPress theme or plugin ';
$out .= 'Optimized for multilingual SEO ';
$out .= '14-day Free trial and free plan available ';
$out .= ' ';
$out .= '';
$out .= '
';
$out .= '
';
// weglot install dialog
return $out;
} // pro_dialog
public function tab_footer($tab = false)
{
echo '';
}
/**
* Echoes content for themes tab
*
* @return null
*/
private function tab_themes_premade()
{
echo '
Themes
';
echo '
Are you in a hurry? Looking for something that looks great for your site? Pick one of +200 premium pre-built themes and be done in 5 minutes! Our PRO plugin comes with built-in SEO analyzer, a collection of over 7 million images and it can connect to any mailing system like Mailchimp so you can start collecting emails from day one! Did we mention you can rebrand the plugin and control all client sites from the plugin\'s centralized Dashboard?
';
$options = $this->get_options();
echo '
';
$themes = [
'5f2f8c65307b6f3097f2ca4d25d5cb26' => 'Adventure Blog',
'883f61d5131f6c7b558ccde9c5d1f411' => 'Analytics',
'00cf8a2ca9efec1e8aea483568e2a8d8' => 'Baby Store',
'ccdbb99fd1dfecd36e13d5a4cff45d21' => 'Burger Palace',
'0a0c5efe1e95f91a42bc9e6e6ca884dd' => 'Business',
'781cb3af776a041533735bdfc59e811a' => 'Car Repair',
'e8e6f070f05eae0367699e6dc7963439' => 'Design Agency',
'06142f926b2da71d8dddfba3254a78cb' => 'Digital Marketing Agency',
'd41b1b0a6d4cb304e886121b3118cfa0' => 'Fashion',
'7f96d3918bd5840258a6dce654f4b0dc' => 'Flower Shop',
'b6e3012a316272608e1bbfac4d6b5a78' => 'Food Recommendation',
'310e65d9600903508451d5670ab0c33f' => 'Freelance',
'1c498ed60de01a93c2a4cac0ab50ddc2' => 'Gaming',
'da24f016888540131b49800c7b8cb07e' => 'Health Service',
'4dc670fa8069dd1293b85cf6235ceb25' => 'Hiking',
'bb9f78a54648fe776fe7cdce018d4649' => 'Interior Design',
'0888b7c6cfdfde868ad842b76f47dbdc' => 'Jewelry Shop',
'9dd2a18f38bcfdcb6fce7b037c22e1ec' => 'Marketing',
'bce5308440264fa4a8ce9cf1b38f3242' => 'Mobile App',
'b20f2da4e5cd0753638723ff12383378' => 'Non-Profit Organization',
'2c6c47a437172cf970e9027ab7c4f680' => 'Photography',
'ea2584e286d8e0304994f4d9d9e4d335' => 'Podcast',
'f7432f296c75f398c018ebbd0118cf1f' => 'Product Marketing',
'274bd92fd91aadc05fe0637f614633d8' => 'Restaurant',
'1ff8ca16c5010eec8797eb5416373c6d' => 'Skincare',
'eb668b7221bb4ed50c8edc8aebb68ba4' => 'Sport',
'a61a5890d7db6cef943729dc082f24e0' => 'Tech Conference',
'1e26f176878e01991d42463cce0d3182' => 'Training',
'906d50132e2caf64ad57d9c76b07f78c' => 'Travel Vlog',
'd1dd1f82d0d557460f22ac7058c291e0' => 'Wedding',
'35b404155b3be97d198dadf05ddfc960' => 'Wellness',
'293e20f552ddd1e851351a93408be322' => 'Winery',
];
echo '
';
echo '
';
echo '
';
echo 'Default Theme';
echo '
';
echo '
';
echo '
';
foreach ($themes as $theme_id => $theme_name) {
echo '
';
echo '
';
echo '
';
echo esc_html(substr($theme_name, 0, 30));
echo '
';
echo '
';
echo '
';
echo '
';
}
echo '
';
$this->tab_footer();
} // tab_themes
/**
* Echoes content for access tab
*
* @return null
*/
private function tab_access()
{
$options = $this->get_options();
echo '
Access
';
echo '
By default, if Maintenance mode is enabled, all site visitors except the logged in ones (regardless of their user role) will see the Maintenance page instead of the "normal" site. The easiest way to show the site to clients or friends is to share the Secret Access Link, or whitelist their IP address if it doesn\'t change too often.
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
$this->tab_footer();
} // tab_access
/**
* Echoes content for access password tab
*
* @return null
*/
private function tab_access_password()
{
$options = $this->get_options();
echo '
Password Protection
';
echo '
By default, if Maintenance mode is enabled, all site visitors except the logged in ones (regardless of their user role) will see the Maintenance page instead of the "normal" site. The easiest way to show the site to clients or friends is to share the Secret Access Link, or whitelist their IP address if it doesn\'t change too often.
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
Password PRO ';
echo '
';
echo '
The password has to be at least 4 characters long.
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
$this->tab_footer();
} // tab_access_password
/**
* Admin footer text
*
* @since 5.0
*
* @return null
*/
public function admin_footer_text($text)
{
if (!$this->is_plugin_page()) {
return $text;
}
$text = '';
return $text;
} // admin_footer_text
/**
* Add links to plugin's description in plugins table
*
* @param array $links Initial list of links.
* @param string $file Basename of current plugin.
*
* @return array
*/
function plugin_meta_links($links, $file)
{
if ($file !== plugin_basename(__FILE__)) {
return $links;
}
$support_link = '
Support ';
$home_link = '
Plugin Homepage ';
$links[] = $support_link;
$links[] = $home_link;
return $links;
} // plugin_meta_links
/**
* Helper function for generating UTM tagged links
*
* @param string $placement Optional. UTM content param.
* @param string $page Optional. Page to link to.
* @param array $params Optional. Extra URL params.
* @param string $anchor Optional. URL anchor part.
*
* @return string
*/
public function generate_web_link($placement = '', $page = '/', $params = array(), $anchor = '')
{
$base_url = 'https://wpmaintenancemode.com';
if ('/' != $page) {
$page = '/' . trim($page, '/') . '/';
}
if ($page == '//') {
$page = '/';
}
$parts = array_merge(array('utm_source' => 'maintenance-free', 'utm_content' => $placement), $params);
if (!empty($anchor)) {
$anchor = '#' . trim($anchor, '#');
}
$out = $base_url . $page . '?' . http_build_query($parts, '', '&') . $anchor;
return $out;
} // generate_web_link
function generate_dashboard_link($placement = '', $page = '/', $params = array(), $anchor = '')
{
$base_url = 'https://dashboard.wpmaintenancemode.com';
if ('/' != $page) {
$page = '/' . trim($page, '/') . '/';
}
if ($page == '//') {
$page = '/';
}
$parts = array_merge(array('utm_source' => 'maintenance-free', 'utm_medium' => 'plugin', 'utm_content' => $placement, 'utm_campaign' => 'maintenance-free-v' . $this->version), $params);
if (!empty($anchor)) {
$anchor = '#' . trim($anchor, '#');
}
$out = $base_url . $page . '?' . http_build_query($parts, '', '&') . $anchor;
return $out;
} // generate_dashboard_link
/**
* Echoes content for design header such as theme name
*
* @return null
*/
private function design_header()
{
$options = $this->get_options();
echo '
';
if ($options['theme_global'] == $this->theme_id) {
echo '
';
}
echo 'Editing theme
' . esc_html($this->theme->name) . ' ';
echo '
switch theme ';
echo '
';
}
/**
* Echoes content for design-general tab
*
* @return null
*/
private function tab_design_general()
{
$fonts = $this->get_fonts();
$options = $this->get_options();
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
$this->tab_footer('design');
} // tab_design_general
/**
* Echoes content for design-background tab
*
* @return null
*/
private function tab_design_background()
{
$options = $this->get_options();
$filters = array(
array('val' => '', 'label' => 'No Filter'),
array('label' => '1977', 'val' => ' _1977'),
array('label' => 'Aden', 'val' => ' aden'),
array('label' => 'Black & White', 'val' => ' blackwhite'),
array('label' => 'Brannan', 'val' => ' brannan'),
array('label' => 'Brooklyn', 'val' => ' brooklyn'),
array('label' => 'Clarendon', 'val' => ' clarendon'),
array('label' => 'Earlybird', 'val' => ' earlybird'),
array('label' => 'Gingham', 'val' => ' gingham'),
array('label' => 'Hudson', 'val' => ' hudson'),
array('label' => 'Inkwell', 'val' => ' inkwell'),
array('label' => 'Kelvin', 'val' => ' kelvin'),
array('label' => 'Lark', 'val' => ' lark'),
array('label' => 'Lo-Fi', 'val' => ' lofi'),
array('label' => 'Maven', 'val' => ' maven'),
array('label' => 'Mayfair', 'val' => ' mayfair'),
array('label' => 'Moon', 'val' => ' moon'),
array('label' => 'Nashville', 'val' => ' nashville'),
array('label' => 'Perpetua', 'val' => ' perpetua'),
array('label' => 'Reyes', 'val' => ' reyes'),
array('label' => 'Rise', 'val' => ' rise'),
array('label' => 'Slumber', 'val' => ' slumber'),
array('label' => 'Stinson', 'val' => ' stinson'),
array('label' => 'Toaster', 'val' => ' toaster'),
array('label' => 'Valencia', 'val' => ' valencia'),
array('label' => 'Walden', 'val' => ' walden'),
array('label' => 'Willow', 'val' => ' willow'),
array('label' => 'X-pro II', 'val' => ' xpro2'),
);
echo '
Background
';
echo '
The background image makes or breaks the whole page. Take your time to choose a perfect image from our gallery of 400,000+ images and then make it pop by using filters. If you don\'t have much content to show, then choose a video background.
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
Preloader image to replace the default gear icon.
';
echo '
';
echo '
';
echo '
';
$this->tab_footer('design');
} // tab_design_background
/**
* Echoes content for design-layout tab
*
* @return null
*/
private function tab_design_layout()
{
$modules = $this->get_modules();
// Modules
echo '
Available Modules ';
echo '
';
foreach ($modules as $module => $module_properties) {
echo '';
if ($module_properties['pro'] === true) {
echo 'PRO
';
}
echo ' ';
echo '' . esc_html($module_properties['name']) . ' ';
echo '' . esc_html($module_properties['name']) . ' ';
echo '
';
echo '
';
echo '
';
echo '
';
echo '';
}
echo '
';
//Layout
echo '';
echo '
';
echo '';
echo '
';
echo '
';
$this->tab_footer('design');
echo '
';
echo ' ';
} // tab_design_layout
/**
* Echoes content for design-css tab
*
* @return null
*/
public function tab_design_css()
{
echo 'Custom CSS
';
echo 'Custom CSS applies to current theme only. Please double-check any custom code you enter in the settings below. Any typos or mistakes will affect the appearance of the page.
';
echo '
';
echo '';
echo 'Write only the CSS code. Do not include the <style> tags. Code is placed in the page\'s <head> tag.
';
$this->tab_footer('design');
} //tab_design_css
/**
* Echoes content for settings tab
*
* @return null
*/
private function tab_seo()
{
$options = $this->get_options();
echo 'SEO
';
echo 'Carefully craft your content in order to rank your site as best as possible from day one. Use the SEO Analysis tool to improve weak areas.
';
//SEO Preview and Analysis
echo '';
echo '
';
echo '
';
echo '
';
echo '';
//SEO Title
echo '
';
//Meta Description
echo '
';
echo '
';
echo '';
//Show normal website to Search Engines?
echo '
';
//Discourage Search Engine crawlers
echo '
';
echo '
';
echo '';
//Favicon
echo '
';
//Social Preview Image
echo '
';
echo '
';
echo '';
//Google Analytics Tracking ID
echo '
';
//Tracking Pixel and 3rd Party Analytics Code
echo '
';
echo '
';
echo '';
//Facebook Page URL
echo '
';
//Twitter @username
echo '
';
echo '
';
$this->tab_footer();
} // tab_seo
/**
* Echoes content for advanced tab
*
* @return null
*/
private function tab_advanced()
{
$options = $this->get_options();
echo 'Advanced
';
echo 'Please double-check any custom code you enter in the settings below. Any typos or mistakes will affect the appearance of the page.
';
echo '';
echo '
';
echo '
';
echo '
';
echo '';
echo '';
echo '
';
$plugin_name = 'Maintenance';
echo '
';
echo '
';
echo '';
echo '
';
echo '
';
echo '
';
echo '';
echo '';
echo 'Maintenance page title ';
echo ' ';
echo '
';
echo '';
echo 'Maintenance page content ';
wp_editor(stripslashes($options['custom_wp_maintenance_content']), 'custom_wp_maintenance_content', $settings = array(
'textarea_rows' => 10,
'media_buttons' => 1,
'teeny' => false,
'editor_class' => 'skip_save',
));
echo '
';
$this->tab_footer();
} // tab_advanced
/**
* Reset Settings
*
* @return null
*/
public function mtnc_reset_settings()
{
check_admin_referer('mtnc_admin_action');
if (!current_user_can('manage_options')) {
wp_send_json_error(__('You are not allowed to run this action.', 'maintenance'));
}
$options = $this->get_options();
$default_theme_id = md5(time() . 'default');
$reset = sanitize_text_field(wp_unslash($_GET['reset'] ?? '')) == 'settings' ? 'settings':'theme';
if($reset == 'theme'){
$new_options = $options;
} else {
$new_options = array(
'status' => '0',
'mode' => 'layout',
'mtnc_page' => 0,
'header_text' => 'Our site is under maintenance!',
//SEO
'title' => get_bloginfo('name') . ' is under maintenance',
'description' => 'We are doing some work on our site. Please come back later. We\'ll be up and running in no time.',
'target_keyword' => 'maintenance',
'excludese' => '0',
'blockse' => '0',
'favicon' => '',
'social_preview' => '',
'analytics' => '',
'tracking_pixel' => '',
'twitter_site' => '',
'facebook_site' => '',
//Access
'show_logged_in' => '1',
'ip_whitelist' => '',
'per_url_settings' => '',
'per_url_enable_disable' => '',
'direct_access_link' => '',
'custom_login_url' => '',
'login_button' => '1',
'wplogin_button_tooltip' => 'Access WordPress admin',
'maintenance_password' => '',
'site_password' => '',
'password_button' => '0',
'login_button_text' => 'Access the Site',
'login_message' => 'Please enter the password to access the site',
'login_wrong_password_text' => 'Wrong password',
'login_button_tooltip' => 'Direct Access login',
//Advanced
'no_cache_headers' => '1',
'disable_toolbar_menu' => '',
'force_ssl' => '',
'enable_rest' => '',
'custom_wp_maintenance' => '',
'custom_wp_maintenance_title' => '',
'custom_wp_maintenance_content' => '',
'upgraded' => $options['upgraded']
);
}
$new_options['theme_global'] = $default_theme_id;
$new_options['themes'] = array($default_theme_id => json_decode(
'{
"modules": {
"header-dbd02cd1": {
"name": "Header",
"type": "header",
"groups": {
"header": {
"name": "Header",
"active": true,
"fields": {
"text": {
"type": "text",
"name": "text",
"label": "Text",
"value": "Site is undergoing maintenance",
"class": "full-width",
"desc": ""
},
"text_align": {
"type": "radio",
"name": "text_align",
"label": "Text Align",
"class": "",
"values": {
"left": "Left",
"center": "Center",
"right": "Right"
},
"value": "center"
},
"font_size": {
"type": "range",
"name": "font_size",
"label": "Font Size",
"value": "47",
"min": 6,
"max": 120,
"class": "",
"units": {
"px": "px",
"pt": "pt",
"em": "em"
},
"unit_value": "px"
},
"color": {
"type": "color",
"name": "text_color",
"label": "Color",
"value": "rgba(255,255,255,1)",
"desc": ""
},
"font": {
"type": "font",
"name": "font",
"label": "Font",
"value": "Open Sans",
"class": "full-width",
"desc": ""
},
"line_height": {
"type": "number",
"name": "line_height",
"label": "Line Height",
"value": "2",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "em",
"class": "number_small",
"desc": ""
}
}
},
"layout": {
"name": "Layout",
"fields": {
"padding_label": {
"type": "label",
"name": "padding_label",
"label": "Padding"
},
"padding_top": {
"type": "number",
"name": "padding_top",
"label": "Top",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/padding_top.png",
"value": "10",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"padding_bottom": {
"type": "number",
"name": "padding_bottom",
"label": "Bottom",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/padding_bottom.png",
"value": "10",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"padding_left": {
"type": "number",
"name": "padding_left",
"label": "Left",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/padding_left.png",
"value": "0",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"padding_right": {
"type": "number",
"name": "padding_right",
"label": "Right",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/padding_right.png",
"value": "0",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"margin_label": {
"type": "label",
"name": "margin_label",
"label": "Margin"
},
"margin_top": {
"type": "number",
"name": "margin_top",
"label": "Top",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/margin_top.png",
"value": "0",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"margin_bottom": {
"type": "number",
"name": "margin_bottom",
"label": "Bottom",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/margin_bottom.png",
"value": "0",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"margin_left": {
"type": "number",
"name": "margin_left",
"label": "Left",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/margin_left.png",
"value": "0",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"margin_right": {
"type": "number",
"name": "margin_right",
"label": "Right",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/margin_right.png",
"value": "0",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"background_label": {
"type": "label",
"name": "background_label",
"label": "Background"
},
"background_color": {
"type": "color",
"name": "background_color",
"nolabel": true,
"value": "rgba(255,255,255,0)",
"desc": ""
},
"background": {
"type": "image",
"name": "background",
"nolabel": true,
"value": "",
"class": "",
"desc": ""
}
}
}
}
},
"content-471365b7": {
"name": "Content",
"type": "content",
"groups": {
"col1": {
"name": "Footer",
"active": true,
"fields": {
"text": {
"type": "textarea",
"name": "text",
"label": "Text",
"value": "Maintenance mode is on",
"class": "full-width",
"desc": ""
},
"font_size": {
"type": "number",
"name": "font_size",
"label": "Font Size",
"value": "36",
"class": "number_small",
"units": {
"px": "px",
"pt": "pt",
"em": "em"
},
"unit_value": "px"
},
"color": {
"type": "color",
"name": "text_color",
"label": "Color",
"value": "rgba(255,255,255,1)",
"desc": ""
},
"font": {
"type": "font",
"name": "font",
"label": "Font",
"value": "Open Sans",
"class": "full-width",
"desc": ""
},
"line_height": {
"type": "number",
"name": "line_height",
"label": "Line Height",
"value": "1",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "em",
"class": "number_small",
"desc": ""
}
}
},
"layout": {
"name": "Layout",
"fields": {
"padding_label": {
"type": "label",
"name": "padding_label",
"label": "Padding"
},
"padding_top": {
"type": "number",
"name": "padding_top",
"label": "Top",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/padding_top.png",
"value": "100",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"padding_bottom": {
"type": "number",
"name": "padding_bottom",
"label": "Bottom",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/padding_bottom.png",
"value": "10",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"padding_left": {
"type": "number",
"name": "padding_left",
"label": "Left",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/padding_left.png",
"value": "0",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"padding_right": {
"type": "number",
"name": "padding_right",
"label": "Right",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/padding_right.png",
"value": "0",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"margin_label": {
"type": "label",
"name": "margin_label",
"label": "Margin"
},
"margin_top": {
"type": "number",
"name": "margin_top",
"label": "Top",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/margin_top.png",
"value": "0",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"margin_bottom": {
"type": "number",
"name": "margin_bottom",
"label": "Bottom",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/margin_bottom.png",
"value": "0",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"margin_left": {
"type": "number",
"name": "margin_left",
"label": "Left",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/margin_left.png",
"value": "0",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"margin_right": {
"type": "number",
"name": "margin_right",
"label": "Right",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/margin_right.png",
"value": "0",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"background_label": {
"type": "label",
"name": "background_label",
"label": "Background"
},
"background_color": {
"type": "color",
"name": "background_color",
"nolabel": true,
"value": "rgba(255,255,255,0)",
"desc": ""
},
"background": {
"type": "image",
"name": "background",
"nolabel": true,
"value": "",
"class": "",
"desc": ""
}
}
}
}
},
"content-9742e2f8": {
"name": "Content",
"type": "content",
"groups": {
"col1": {
"name": "Footer",
"active": true,
"fields": {
"text": {
"type": "textarea",
"name": "text",
"label": "Text",
"value": "Site will be available soon. Thank you for your patience!",
"class": "full-width",
"desc": ""
},
"font_size": {
"type": "number",
"name": "font_size",
"label": "Font Size",
"value": "20",
"class": "number_small",
"units": {
"px": "px",
"pt": "pt",
"em": "em"
},
"unit_value": "px"
},
"color": {
"type": "color",
"name": "text_color",
"label": "Color",
"value": "rgba(255,255,255,1)",
"desc": ""
},
"font": {
"type": "font",
"name": "font",
"label": "Font",
"value": "Open Sans",
"class": "full-width",
"desc": ""
},
"line_height": {
"type": "number",
"name": "line_height",
"label": "Line Height",
"value": "1",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "em",
"class": "number_small",
"desc": ""
}
}
},
"layout": {
"name": "Layout",
"fields": {
"padding_label": {
"type": "label",
"name": "padding_label",
"label": "Padding"
},
"padding_top": {
"type": "number",
"name": "padding_top",
"label": "Top",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/padding_top.png",
"value": "10",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"padding_bottom": {
"type": "number",
"name": "padding_bottom",
"label": "Bottom",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/padding_bottom.png",
"value": "10",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"padding_left": {
"type": "number",
"name": "padding_left",
"label": "Left",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/padding_left.png",
"value": "0",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"padding_right": {
"type": "number",
"name": "padding_right",
"label": "Right",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/padding_right.png",
"value": "0",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"margin_label": {
"type": "label",
"name": "margin_label",
"label": "Margin"
},
"margin_top": {
"type": "number",
"name": "margin_top",
"label": "Top",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/margin_top.png",
"value": "0",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"margin_bottom": {
"type": "number",
"name": "margin_bottom",
"label": "Bottom",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/margin_bottom.png",
"value": "0",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"margin_left": {
"type": "number",
"name": "margin_left",
"label": "Left",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/margin_left.png",
"value": "0",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"margin_right": {
"type": "number",
"name": "margin_right",
"label": "Right",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/margin_right.png",
"value": "0",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"background_label": {
"type": "label",
"name": "background_label",
"label": "Background"
},
"background_color": {
"type": "color",
"name": "background_color",
"nolabel": true,
"value": "rgba(255,255,255,0)",
"desc": ""
},
"background": {
"type": "image",
"name": "background",
"nolabel": true,
"value": "",
"class": "",
"desc": ""
}
}
}
}
},
"footer-a29820d6": {
"name": "Footer",
"type": "footer",
"groups": {
"col1": {
"name": "Footer",
"active": true,
"fields": {
"text": {
"type": "textarea",
"name": "text",
"label": "Text",
"value": "© Maintenance 2026",
"class": "full-width",
"desc": ""
},
"font_size": {
"type": "number",
"name": "font_size",
"label": "Font Size",
"value": "24",
"class": "number_small",
"units": {
"px": "px",
"pt": "pt",
"em": "em"
},
"unit_value": "px"
},
"color": {
"type": "color",
"name": "text_color",
"label": "Color",
"value": "rgba(255,255,255,1)",
"desc": ""
},
"font": {
"type": "font",
"name": "font",
"label": "Font",
"value": "Open Sans",
"class": "full-width",
"desc": ""
},
"line_height": {
"type": "number",
"name": "line_height",
"label": "Line Height",
"value": "1",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "em",
"class": "number_small",
"desc": ""
}
}
},
"layout": {
"name": "Layout",
"fields": {
"padding_label": {
"type": "label",
"name": "padding_label",
"label": "Padding"
},
"padding_top": {
"type": "number",
"name": "padding_top",
"label": "Top",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/padding_top.png",
"value": "10",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"padding_bottom": {
"type": "number",
"name": "padding_bottom",
"label": "Bottom",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/padding_bottom.png",
"value": "10",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"padding_left": {
"type": "number",
"name": "padding_left",
"label": "Left",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/padding_left.png",
"value": "0",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"padding_right": {
"type": "number",
"name": "padding_right",
"label": "Right",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/padding_right.png",
"value": "0",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"margin_label": {
"type": "label",
"name": "margin_label",
"label": "Margin"
},
"margin_top": {
"type": "number",
"name": "margin_top",
"label": "Top",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/margin_top.png",
"value": "0",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"margin_bottom": {
"type": "number",
"name": "margin_bottom",
"label": "Bottom",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/margin_bottom.png",
"value": "0",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"margin_left": {
"type": "number",
"name": "margin_left",
"label": "Left",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/margin_left.png",
"value": "0",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"margin_right": {
"type": "number",
"name": "margin_right",
"label": "Right",
"image_label": "' . trailingslashit(MTNC_URL) . 'img/icons/margin_right.png",
"value": "0",
"class": "number_small",
"units": {
"px": "px",
"percent": "%",
"em": "em"
},
"unit_value": "px",
"wrapper_class": "col-4"
},
"background_label": {
"type": "label",
"name": "background_label",
"label": "Background"
},
"background_color": {
"type": "color",
"name": "background_color",
"nolabel": true,
"value": "rgba(255,255,255,0)",
"desc": ""
},
"background": {
"type": "image",
"name": "background",
"nolabel": true,
"value": "",
"class": "",
"desc": ""
}
}
}
}
}
},
"modules_order": {
"header-dbd02cd1": "header-dbd02cd1",
"content-471365b7": "content-471365b7",
"content-9742e2f8": "content-9742e2f8",
"footer-a29820d6": "footer-a29820d6"
},
"name": "Default",
"theme_thumbnail": "",
"theme_status": "",
"body_font_size": "16",
"body_font_color": "#FFFFFF",
"body_font": "Open Sans",
"body_link_color": "#0096FF",
"body_link_hover_color": "#57BAFF",
"background_type": "image",
"background_video": "",
"background_video_fallback": "",
"background_video_filter": "",
"background_size_opt": "cover",
"background_position": "center center",
"background_image_filter": "",
"background_blur": 0,
"background_image": "' . trailingslashit(MTNC_URL) . 'img/mt-sample-background.jpg",
"preloader_background_image": "",
"background_color": "rgba(0,0,0,1)",
"login_background_color": "rgba(0,0,0,1)",
"content_overlay": "",
"content_width": 916,
"content_overlay_color": "rgba(0,0,0,0.2)",
"content_overlay_shadow_color": "rgba(0,0,0,0.2)",
"content_position": "middle",
"modules_spacing": 20,
"custom_css": ".mtnc_module,\r\n.mtnc_module h2{\r\n\tfont-weight:300;\r\n}"
}'
)
);
$this->update_options('options', $new_options);
if (!empty($_GET['redirect'])) {
if($reset == 'theme'){
wp_safe_redirect(admin_url('admin.php?page=maintenance&theme-reset=true'));
} else {
wp_safe_redirect(admin_url('admin.php?page=maintenance&settings-reset=true'));
}
}
die();
}
/**
* Create select options
*
* @param array $options Options
* @param string $selected current value
* @param bool $output current value
*
* @return string html if $output is false
*/
public function create_select_options($options, $selected = null, $output = true)
{
$out = "\n";
foreach ($options as $option) {
$disabled = '';
if (isset($option['disabled'])) {
$disabled .= ' disabled="disabled" ';
}
$out .= '' . $option['label'] . ' ';
} // foreach
if ($output) {
self::wp_kses_wf($out);
} else {
return $out;
}
} // create_select_options
/**
* Generate CSS Style for a module for front-end display
*
* @param object $module object
*
* @return string CSS styles
*/
public function get_module_style($module)
{
$styles = 'padding:0px; margin:' . round($this->theme->modules_spacing / 2) . 'px auto; text-align:center;';
//Padding
if (!empty($module->groups->layout->fields->padding_top->value)) {
$styles .= 'padding-top:' . $module->groups->layout->fields->padding_top->value . str_replace('percent', '%', $module->groups->layout->fields->padding_top->unit_value) . ';';
}
if (!empty($module->groups->layout->fields->padding_right->value)) {
$styles .= 'padding-right:' . $module->groups->layout->fields->padding_right->value . str_replace('percent', '%', $module->groups->layout->fields->padding_right->unit_value) . ';';
}
if (!empty($module->groups->layout->fields->padding_bottom->value)) {
$styles .= 'padding-bottom:' . $module->groups->layout->fields->padding_bottom->value . str_replace('percent', '%', $module->groups->layout->fields->padding_bottom->unit_value) . ';';
}
if (!empty($module->groups->layout->fields->padding_left->value)) {
$styles .= 'padding-left:' . $module->groups->layout->fields->padding_left->value . str_replace('percent', '%', $module->groups->layout->fields->padding_left->unit_value) . ';';
}
//Margin
if (!empty($module->groups->layout->fields->margin_top->value)) {
$styles .= 'margin-top:' . $module->groups->layout->fields->margin_top->value . str_replace('percent', '%', $module->groups->layout->fields->margin_top->unit_value) . ';';
}
if (!empty($module->groups->layout->fields->margin_right->value)) {
$styles .= 'margin-right:' . $module->groups->layout->fields->margin_right->value . str_replace('percent', '%', $module->groups->layout->fields->margin_right->unit_value) . ';';
}
if (!empty($module->groups->layout->fields->margin_bottom->value)) {
$styles .= 'margin-bottom:' . $module->groups->layout->fields->margin_bottom->value . str_replace('percent', '%', $module->groups->layout->fields->margin_bottom->unit_value) . ';';
}
if (!empty($module->groups->layout->fields->margin_left->value)) {
$styles .= 'margin-left:' . $module->groups->layout->fields->margin_left->value . str_replace('percent', '%', $module->groups->layout->fields->margin_left->unit_value) . ';';
}
//Background
if (!empty($module->groups->layout->fields->background_color->value)) {
$styles .= 'background-color:' . $module->groups->layout->fields->background_color->value . ';';
}
if (!empty($module->groups->layout->fields->background->value)) {
$styles .= 'background:url(' . $module->groups->layout->fields->background->value . ');';
}
if ($module->type == 'footer') {
$styles .= 'position:absolute; bottom:0px; left: 0px;';
}
return $styles;
}
/**
* Convert GA Code
*
* @param string GA Code
*
* @return string GA Code
*/
public function convert_ga($code)
{
if (empty($code) || strpos($code, '';
echo ' If you are not redirected in a few seconds - click here .';
}
} else {
echo 'Could not install WP Force SSL. You\'ll have to download and install manually .';
}
echo ' ';
} // install_wpfssl
// auto download / install / activate Advanced Google reCAPTCHA plugin
function install_wpcaptcha()
{
check_ajax_referer('install_wpcaptcha');
if (false === current_user_can('administrator')) {
wp_die('Sorry, you have to be an admin to run this action.');
}
$plugin_slug = 'advanced-google-recaptcha/advanced-google-recaptcha.php';
$plugin_zip = 'https://downloads.wordpress.org/plugin/advanced-google-recaptcha.latest-stable.zip';
@include_once ABSPATH . 'wp-admin/includes/plugin.php';
@include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
@include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
@include_once ABSPATH . 'wp-admin/includes/file.php';
@include_once ABSPATH . 'wp-admin/includes/misc.php';
echo '';
echo '
';
echo 'If things are not done in a minute
install the plugin manually via Plugins page ';
echo 'Starting ...
';
wp_cache_flush();
$upgrader = new Plugin_Upgrader();
echo 'Check if Advanced Google reCAPTCHA is already installed ...
';
if ($this->is_plugin_installed($plugin_slug)) {
echo 'Advanced Google reCAPTCHA is already installed!
Making sure it\'s the latest version.
';
$upgrader->upgrade($plugin_slug);
$installed = true;
} else {
echo 'Installing Advanced Google reCAPTCHA.
';
$installed = $upgrader->install($plugin_zip);
}
wp_cache_flush();
if (!is_wp_error($installed) && $installed) {
echo 'Activating Advanced Google reCAPTCHA.
';
$activate = activate_plugin($plugin_slug);
if (is_null($activate)) {
echo 'Advanced Google reCAPTCHA Activated.
';
echo '';
echo '
If you are not redirected in a few seconds -
click here .';
}
} else {
echo 'Could not install Advanced Google reCAPTCHA. You\'ll have to
download and install manually .';
}
echo '
';
} // install_wpcaptcha
// auto download / install / activate Weglot plugin
function install_weglot()
{
check_ajax_referer('install_weglot');
if (false === current_user_can('administrator')) {
wp_die('Sorry, you have to be an admin to run this action.');
}
$plugin_slug = 'weglot/weglot.php';
$plugin_zip = 'https://downloads.wordpress.org/plugin/weglot.latest-stable.zip';
@include_once ABSPATH . 'wp-admin/includes/plugin.php';
@include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
@include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
@include_once ABSPATH . 'wp-admin/includes/file.php';
@include_once ABSPATH . 'wp-admin/includes/misc.php';
echo '';
echo '
';
echo 'If things are not done in a minute
install the plugin manually via Plugins page ';
echo 'Starting ...
';
wp_cache_flush();
$upgrader = new Plugin_Upgrader();
echo 'Check if Weglot is already installed ...
';
if ($this->is_plugin_installed($plugin_slug)) {
echo 'Weglot is already installed!
Making sure it\'s the latest version.
';
$upgrader->upgrade($plugin_slug);
$installed = true;
} else {
echo 'Installing Weglot.
';
$installed = $upgrader->install($plugin_zip);
}
wp_cache_flush();
if (!is_wp_error($installed) && $installed) {
echo 'Activating Weglot.
';
$activate = activate_plugin($plugin_slug);
if (is_null($activate)) {
echo 'Weglot Activated.
';
echo '';
echo '
If you are not redirected in a few seconds -
click here .';
}
} else {
echo 'Could not install Weglot. You\'ll have to
download and install manually .';
}
echo '
';
} // install_weglot
/**
* Disabled; we use singleton pattern so magic functions need to be disabled
*
* @return null
*/
public function __clone() {}
/**
* Disabled; we use singleton pattern so magic functions need to be disabled
*
* @return null
*/
public function __sleep() {}
/**
* Disabled; we use singleton pattern so magic functions need to be disabled
*
* @return null
*/
public function __wakeup() {}
} // MTNC class
// Create plugin instance and hook things up
global $wf_mtnc; //phpcs:ignore
$wf_mtnc = MTNC::getInstance(); //phpcs:ignore