Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * Plugin Name: a-my-custom-plugin
- * Description: My custom plugin
- * Text Domain: a-my-custom-plugin
- * Domain Path: /languages
- * Version: 1.22
- * WordPress URI: https://wordpress.org/plugins/
- * Plugin URI: https://puvox.software/wordpress/
- * Contributors: puvoxsoftware,ttodua
- * Author: puvox.software
- * Author URI: https://puvox.software/profile
- * Donate Link: https://paypal.me/Puvox
- * License: GPL-3.0
- * License URI: https://www.gnu.org/licenses/gpl-3.0.html
- * @copyright: Puvox.software
- */
- namespace PuvoxSoftware
- {
- if (!defined('ABSPATH')) exit;
- //$lib_final=dirname(__DIR__)."/".($name='default_library_puvox.php');
- $lib_final=__DIR__."/library/".($name='default_library_puvox_PHP.php');
- if( file_exists($lib_start=__DIR__."/$name") && !defined("_puvox_machine_") ) { rename($lib_start, $lib_final); } require_once($lib_final);
- class PluginClass extends \default_plugin__PuvoxSoftware
- {
- public function declare_settings()
- {
- $this->initial_static_options =
- [
- 'has_pro_version' =>0,
- 'show_opts' =>true,
- 'show_rating_message'=>false,
- 'display_tabs' =>false,
- 'required_role' =>'install_plugins',
- 'default_managed' =>'network', //network, singlesite
- ];
- $this->initial_user_options =
- [
- ];
- }
- public function __construct_my()
- {
- //
- $this->helpers->error_to_mailaddress = 'your_mail@gmail.com'; // send errors to email
- $this->helpers->enable_write_logs = false; // enable logs writing
- $this->helpers->PASSWORD_FOR_SITE = ''; //
- $this->helpers->google_analytics_ID = ''; //
- $this->helpers->google_tag_manager_ID = ''; //
- $this->helpers->top_ge_ID = ''; //
- $this->helpers->google_firebase_ID = ''; // https://console.firebase.google.com/project/my-test-proj-fc1cb/overview
- $this->helpers->auth_expiration_hours = 444; //
- $this->helpers->posts_per_page = 20; //
- $this->helpers->search_items_amount_in_menu = 20; //
- $this->helpers->shortcodes = []; //
- $this->helpers->customOptsPageUrl = admin_url().'/.../'; //
- $this->helpers->remove_comments_url = true; //
- $this->helpers->extend_shortcodes = true; // activates shortcodes: image, video, link, iframe, @, script, video, list_subpages ,
- // i.e. [list type="categories" id="32" depth=0 exclude="4,28"]
- // i.e. [list type="pages" id="32" depth=0 exclude="4,28"] (or id="this")
- // i.e. [list type="menu" id="32"]
- $this->helpers->disable_update = true; // disable update for current plugin
- $this->add_my_site_options(['smth'=>'value']); // activates extra options page
- $this->admin_styles = '<style>.xxx{}</style>';
- $this->helpers->load_scripts_override =
- [
- 'jquery' => ['screen'=>['admin'=>0, 'public'=>0], 'urls'=>[
- 'js' => '//cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js'
- ]],
- 'jquery-migrate'=> ['screen'=>['admin'=>0, 'public'=>0], 'urls'=>[
- 'js' => '//cdnjs.cloudflare.com/ajax/libs/jquery-migrate/3.0.1/jquery-migrate.min.js'
- ]],
- 'jquery-ui' => ['screen'=>['admin'=>0, 'public'=>0], 'urls'=>[
- 'css' =>'//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.css',
- 'js' => '//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js',
- ]],
- 'bootstrap' => ['screen'=>['admin'=>0, 'public'=>0], 'urls'=>[
- 'css'=> '//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css',
- 'js' => '//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js',
- ]],
- 'less' => ['screen'=>['admin'=>0, 'public'=>0], 'urls'=>[
- 'js' => '//cdnjs.cloudflare.com/ajax/libs/less.js/3.9.0/less.min.js',
- ]],
- 'font-awesome' => ['screen'=>['admin'=>0, 'public'=>0], 'urls'=>[
- 'css'=> '//use.fontawesome.com/releases/v5.6.3/css/all.css',
- ]],
- 'font-awesome-animations1'=> ['screen'=>['admin'=>0, 'public'=>0], 'urls'=>[
- 'css'=> '//cdnjs.cloudflare.com/ajax/libs/font-awesome-animation/0.2.1/font-awesome-animation.min.css',
- ]], // https://l-lin.github.io/font-awesome-animation/
- 'google-fonts' => ['screen'=>['admin'=>0, 'public'=>0], 'urls'=>[
- 'css' => '//fonts.googleapis.com/css?family=PT+Sans+Caption:400,700&subset=latin,latin-ext'
- ]],
- 'fancybox' => ['screen'=>['admin'=>0, 'public'=>0], 'urls'=>[
- 'css' => '//cdnjs.cloudflare.com/ajax/libs/fancybox/3.2.5/jquery.fancybox.min.css',
- 'js' => '//cdnjs.cloudflare.com/ajax/libs/fancybox/3.2.5/jquery.fancybox.min.js',
- ]], // http://fancyapps.com/fancybox/
- 'animate' => ['screen'=>['admin'=>0, 'public'=>0], 'urls'=>[
- 'css' => '//cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.0/animate.min.css',
- 'js' => '//cdnjs.cloudflare.com/ajax/libs/animateCSS/1.2.2/jquery.animatecss.min.js',
- ]], //https://codepen.io/strapro/pen/dIqAH https://daneden.github.io/animate.css/
- // Example: https://pastebin_com/xwXQLZES
- 'cookies' => ['screen'=>['admin'=>0, 'public'=>0], 'urls'=>[
- 'js' => 'https://cdnjs.cloudflare.com/ajax/libs/js-cookie/2.2.0/js.cookie.min.js',
- ]],
- 'spin' => ['screen'=>['admin'=>0, 'public'=>0], 'urls'=>[
- 'js' => '//cdnjs.cloudflare.com/ajax/libs/spin.js/2.3.2/spin.min.js',
- ]], // http://spin.js.org/
- 'hover' => ['screen'=>['admin'=>0, 'public'=>0], 'urls'=>[
- 'css' => '//cdnjs.cloudflare.com/ajax/libs/hover.css/2.3.1/css/hover-min.css'
- ]], // https://ianlunn.github.io/Hover/
- 'my_javascript' => ['screen'=>['admin'=>0, 'public'=>0]],
- 'my_style_public' => ['screen'=>['admin'=>0, 'public'=>1]],
- 'my_style_admin' => ['screen'=>['admin'=>1, 'public'=>0]],
- ];
- //if ($this->helpers->property('add_social_links_options')) add_action('admin_menu', [$this,'funccc413']);
- $this->helpers->plugin_reset_callback = function(){}; //
- $this->helpers->hooks_examples = function(){}; //
- }
- // ============================================================================================================== //
- // ============================================================================================================== //
- public function opts_page_output() { $this->settings_page_part("start"); ?>
- <style>
- p.submit { text-align:center; }
- .settingsTitle{display:none;}
- .myplugin {padding:10px;}
- zzz#mainsubmit-button{display:none;}
- .plugin-title{text-align:center;}
- #icon_or_phrase{width:100%;}
- </style>
- <form class="mainForm" method="post" action="">
- <?php if ($this->active_tab=="Options") { ?>
- <?php
- //if form updated
- if( isset($_POST["_wpnonce"]) && check_admin_referer("nonce_".$this->plugin_slug) )
- {
- $this->opts = array_merge($this->opts, $this->array_map_recursive('sanitize_file_name', $_POST[ $this->plugin_slug ]) );
- $this->opts['icon_or_phrase'] = sanitize_text_field( $_POST[ $this->plugin_slug ]['icon_or_phrase'] );
- $this->update_opts();
- }
- return;
- ?>
- <table class="form-table">
- <tbody>
- <tr class="def">
- <th scope="row">
- <label for="">
- <?php _e('Count logged-in members (editor or above) PAGEVIEW?', 'simple-post-views-count');?>
- </label>
- </th>
- <td>
- <?php _e('No', 'simple-post-views-count');?><input type="radio" name="<?php echo $this->plugin_slug;?>[admins_count]" value="no" <?php checked($this->opts[''], "no");?> />
- <?php _e('Yes', 'simple-post-views-count');?><input type="radio" name="<?php echo $this->plugin_slug;?>[admins_count]" value="yes" <?php checked($this->opts[''], "yes");?> />
- </td>
- </tr>
- </tbody>
- </table>
- <?php
- wp_nonce_field( "nonce_".$this->plugin_slug);
- submit_button( false, 'button-primary', '', true, $attrib= array( 'id' => 'mainsubmit-button') );
- ?>
- <?php
- } ?>
- </form>
- <?php $this->settings_page_part("end");
- }
- public function plugin_reset_callback()
- {
- }
- }
- $GLOBALS[__NAMESPACE__] = new PluginClass();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement