+++ /dev/null
-<?php
-
-/*
-Plugin Name: Gaslightify
-Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates
-Description: A gasline to a Wordpress website.
-Version: 1.6.0
-Author: Gaslight Media
-Author URI: http://www.gaslightmedia.com
-License: Gaslight Media
-*/
-
-//function basic_content_replace ($text){
-//$text = str_replace(‘Old’,’New’,$text)
-//return $text;
-//}
-//add_filter(‘the_content’,’basic_content_replace’);
-//add_filter(‘the_title’,’basic_content_replace’);
-
-require_once 'defines.php';
-
- /*
- * Plugin Update Support - uses Gaslight Media update server
- */
- require_once GLM_GASLIGHTIFY_PLUGIN_LIB_PATH.'/opentools-update-checker/opentools-update-checker.php';
- ${GLM_GASLIGHTIFY_PLUGIN_PREFIX."updateChecker"} = new OpenToolsPluginUpdateChecker(
- GLM_GASLIGHTIFY_PLUGIN_UPDATE_SERVER.'/?action=get_metadata&slug='.GLM_GASLIGHTIFY_PLUGIN_SLUG,
- __FILE__,
- GLM_GASLIGHTIFY_PLUGIN_SLUG
- );
- ${GLM_GASLIGHTIFY_PLUGIN_PREFIX."updateChecker"}->declareCredentials(array(
- 'license_key' => __('License Key:')
- ));
-
-add_action('admin_enqueue_scripts', 'interface_client_safeguard');
-
-function interface_client_safeguard() {
- if ( current_user_can( 'manage_options' ) ) {
- /* A user with admin privileges */
- wp_enqueue_style('GaslightifyAdminStyle', plugins_url('css/GaslightifyAdmin.css', __FILE__));
-
- } else {
- /* A user without admin privileges */
- wp_enqueue_script('GaslightifyJs', plugins_url('js/Gaslightify.js', __FILE__),array(),'1.0.0', true);
- wp_enqueue_style('GaslightifyClientsStyle', plugins_url('css/GaslightifyClients.css', __FILE__));
- if ( is_multisite() ) {
- wp_enqueue_style('GaslightifyMultiSiteStyle', plugins_url('css/GaslightifyMultiSite.css', __FILE__));
- }
- }
- if ( !current_user_can( 'edit_posts' ) ) {
- ?>
- <style type="text/css">
- #menu-posts, #menu-comments,
- #glm_members_admin_dashboard_widget,
- #wp-admin-bar-eventregistrations {
- display: none !important;
- }
- </style>
- <?php
- }
- if ( !current_user_can( 'edit_others_posts' ) ) {
- ?>
- <style type="text/css">
- #menu-comments {
- display: none !important;
- }
- </style>
- <?php
- }
- if ( !current_user_can('edit_glmcoupons') ) {
- ?>
- <style type="text/css">
- #menu-posts-glm_coupons {
- display: none !important;
- }
- </style>
- <?php
- }
- if ( !current_user_can('glmclientinfo_edit_client') ) {
- ?>
- <style type="text/css">
- #toplevel_page_glmclientinfo {
- display: none !important;
- }
- </style>
- <?php
- }
- wp_enqueue_style('GaslightifyGlobalStyle', plugins_url('css/GaslightifyGlobal.css', __FILE__));
- add_editor_style( 'scss/admin/tinymce.css' );
-}
-
-add_action('after_setup_theme', 'GLM_general_settings');
-function GLM_general_settings() {
- update_option('image_default_link_type','none');
-}
-function my_admin_theme_style() {
-// wp_enqueue_style('my-admin-theme', plugins_url('css/GaslightifyClients', __FILE__));
-}
-add_action('admin_enqueue_scripts', 'my_admin_theme_style');
-add_action('login_enqueue_scripts', 'my_admin_theme_style');
-
-function my_admin_footer() {
- //echo '<p>This Theme was created by <a href="http://www.gaslightmedia.com">Gaslight Media</a>.</p>';
- echo "";
-}
-
-add_action('admin_footer_text', 'my_admin_footer');
-
-function left_admin_footer_text_output($text) {
-// $text = '<p>This Theme was made by <a href="http://www.gaslightmedia.com">Gaslight Media</a>.</p>';
- return $text;
-}
-
-add_filter('update_footer', 'right_admin_footer_text_output', 11, true); //right side
-function right_admin_footer_text_output($text) {
- $text = '';
- return $text;
-}
-
-add_filter('login_errors','login_error_message');
-
-function login_error_message($error){
- //check if that's the error you are looking for
- $pos = strpos($error, 'incorrect');
- if (is_int($pos)) {
- //its the right error so you can overwrite it
- $error = "Invalid Credentials. Please ensure the username and password you entered are correct.";
- }
- return $error;
-}
-
-add_action('admin_bar_menu', 'glm_custom_logo');
-
-function glm_custom_logo() {
- ?>
- <style type="text/css">
-
-/* #adminmenu .wp-menu-image img {
- content: url(<?php //echo plugins_url(); ?>/Gaslightify/img/GLM_flame_box_inverted_16x16b.png) !important;
- }*/
- #dashboard_activity .no-activity .smiley:before {
- content: url(<?php echo bloginfo('template_url', __FILE__); ?>/assets/DashboardActivityLogo.png);
- }
- #wp-admin-bar-wp-logo > .ab-item .ab-icon:before, #header-logo {
- content: url(<?php echo plugins_url(); ?>/Gaslightify/img/GLM_flame_none_trans_32x32.png) !important;
- }
- #wpadminbar .quicklinks li .blavatar:before {
- content: url(<?php echo plugins_url(); ?>/Gaslightify/img/GLM_flame_none_trans_16x16.png) !important;
- }
-
- </style>
- <?php
-
-}
-
-add_action('login_form','my_login_logo');
-
-function my_login_logo() { ?>
- <style type="text/css">
- // Old dev53 curtain background.
- /*body.login {
- background: url(<?php echo plugins_url(); ?>/Gaslightify/img/bg.jpg) repeat scroll 0 0 #f1f1f1
- }*/
- .login h1,
- .login form {
-/* background: url(<?php echo plugins_url(); ?>/Gaslightify/img/body_bg.png) repeat-x scroll 0 0 rgba(0, 0, 0, 0);*/
- border-radius: 5px;
- padding-top:10px;
- }
- .login #nav {
- display: none;
- }
- #login > h1 > a {
- background-image: url(<?php echo plugins_url(); ?>/Gaslightify/img/GLM_title_box_272x71.gif);
- width: auto;
- background-size: auto;
- }
- </style>
-<?php }
-
-function replace_howdy( $wp_admin_bar ) {
- $my_account=$wp_admin_bar->get_node('my-account');
- $newtitle = str_replace( 'Howdy,', 'Welcome back,', $my_account->title . "!" );
- $wp_admin_bar->add_node( array(
- 'id' => 'my-account',
- 'title' => $newtitle,
- ) );
-}
-add_filter( 'admin_bar_menu', 'replace_howdy',25 );
-function glm_stats(){
- echo '<div class="wrap">
- <style>
- #glm_stats {
- width: 84vw;
- height: 84vh;
- }
- </style>
- <iframe
- frameborder="0"
- width="100%"
- marginheight="0"
- marginwidth="0"
- scrolling="0"
- src="'.get_site_url().'/stats/"
- seamless="true"
- id="glm_stats"></iframe>
- </div>
-';
-}
-function Gaslightify_menu() {
- if ( current_user_can( 'edit_others_pages' ) ) {
- add_menu_page('Server Stats', 'Server Stats', 'edit_posts', 'glm_stats', 'glm_stats', 'dashicons-chart-area');
- if (class_exists('Ninja_Forms')) {
- add_menu_page('Form Submissions', 'Form Submissions', 'edit_posts', 'edit.php?post_type=nf_sub', '', 'dashicons-feedback');
- }
- }
-}
-add_action('admin_menu', 'Gaslightify_menu');
-/* To give Editors access to the Submissions - Simply replace ‘edit_posts’ in the code snippet below with the capability
-that you would like to attach the ability to view/edit submissions to.Please note that all three filters are needed to
-provide proper submission viewing/editing on the backend!
-*/
-function nf_subs_capabilities( $cap ) {
- return 'edit_posts';
-}
-add_filter( 'ninja_forms_admin_submissions_capabilities', 'nf_subs_capabilities' );
-add_filter( 'ninja_forms_admin_parent_menu_capabilities', 'nf_subs_capabilities' );
-//add_filter( 'ninja_forms_admin_menu_capabilities', 'nf_subs_capabilities' );
-add_filter('json_enabled', '__return_false');
-add_filter('json_jsonp_enabled', '__return_false');
-?>
define('GLM_GASLIGHTIFY_PLUGIN_UPDATE_SERVER', 'http://www.gaslightmedia.com/update_server');
define('GLM_GASLIGHTIFY_PLUGIN_PATH', dirname(__FILE__));
+ define('GLM_GASLIGHTIFY_PLUGIN_SLUG', 'Gaslightify');
+
define('GLM_GASLIGHTIFY_PLUGIN_LIB_PATH', GLM_GASLIGHTIFY_PLUGIN_PATH.'/lib');
//define('GLM_GASLIGHTIFY_PLUGIN_LIB_PATH', '');
\ No newline at end of file
--- /dev/null
+<?php
+
+/*
+Plugin Name: Gaslightify
+Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates
+Description: A gasline to a Wordpress website.
+Version: 1.6.1
+Author: Gaslight Media
+Author URI: http://www.gaslightmedia.com
+License: Gaslight Media
+*/
+
+//function basic_content_replace ($text){
+//$text = str_replace(‘Old’,’New’,$text)
+//return $text;
+//}
+//add_filter(‘the_content’,’basic_content_replace’);
+//add_filter(‘the_title’,’basic_content_replace’);
+
+require_once 'defines.php';
+
+ /*
+ * Plugin Update Support - uses Gaslight Media update server
+ */
+ require_once GLM_GASLIGHTIFY_PLUGIN_LIB_PATH.'/opentools-update-checker/opentools-update-checker.php';
+ ${GLM_GASLIGHTIFY_PLUGIN_PREFIX."updateChecker"} = new OpenToolsPluginUpdateChecker(
+ GLM_GASLIGHTIFY_PLUGIN_UPDATE_SERVER.'/?action=get_metadata&slug='.GLM_GASLIGHTIFY_PLUGIN_SLUG,
+ __FILE__,
+ GLM_GASLIGHTIFY_PLUGIN_SLUG
+ );
+ ${GLM_GASLIGHTIFY_PLUGIN_PREFIX."updateChecker"}->declareCredentials(array(
+ 'license_key' => __('License Key:')
+ ));
+
+add_action('admin_enqueue_scripts', 'interface_client_safeguard');
+
+function interface_client_safeguard() {
+ if ( current_user_can( 'manage_options' ) ) {
+ /* A user with admin privileges */
+ wp_enqueue_style('GaslightifyAdminStyle', plugins_url('css/GaslightifyAdmin.css', __FILE__));
+
+ } else {
+ /* A user without admin privileges */
+ wp_enqueue_script('GaslightifyJs', plugins_url('js/Gaslightify.js', __FILE__),array(),'1.0.0', true);
+ wp_enqueue_style('GaslightifyClientsStyle', plugins_url('css/GaslightifyClients.css', __FILE__));
+ if ( is_multisite() ) {
+ wp_enqueue_style('GaslightifyMultiSiteStyle', plugins_url('css/GaslightifyMultiSite.css', __FILE__));
+ }
+ }
+ if ( !current_user_can( 'edit_posts' ) ) {
+ ?>
+ <style type="text/css">
+ #menu-posts, #menu-comments,
+ #glm_members_admin_dashboard_widget,
+ #wp-admin-bar-eventregistrations {
+ display: none !important;
+ }
+ </style>
+ <?php
+ }
+ if ( !current_user_can( 'edit_others_posts' ) ) {
+ ?>
+ <style type="text/css">
+ #menu-comments {
+ display: none !important;
+ }
+ </style>
+ <?php
+ }
+ if ( !current_user_can('edit_glmcoupons') ) {
+ ?>
+ <style type="text/css">
+ #menu-posts-glm_coupons {
+ display: none !important;
+ }
+ </style>
+ <?php
+ }
+ if ( !current_user_can('glmclientinfo_edit_client') ) {
+ ?>
+ <style type="text/css">
+ #toplevel_page_glmclientinfo {
+ display: none !important;
+ }
+ </style>
+ <?php
+ }
+ wp_enqueue_style('GaslightifyGlobalStyle', plugins_url('css/GaslightifyGlobal.css', __FILE__));
+ add_editor_style( 'scss/admin/tinymce.css' );
+}
+
+add_action('after_setup_theme', 'GLM_general_settings');
+function GLM_general_settings() {
+ update_option('image_default_link_type','none');
+}
+function my_admin_theme_style() {
+// wp_enqueue_style('my-admin-theme', plugins_url('css/GaslightifyClients', __FILE__));
+}
+add_action('admin_enqueue_scripts', 'my_admin_theme_style');
+add_action('login_enqueue_scripts', 'my_admin_theme_style');
+
+function my_admin_footer() {
+ //echo '<p>This Theme was created by <a href="http://www.gaslightmedia.com">Gaslight Media</a>.</p>';
+ echo "";
+}
+
+add_action('admin_footer_text', 'my_admin_footer');
+
+function left_admin_footer_text_output($text) {
+// $text = '<p>This Theme was made by <a href="http://www.gaslightmedia.com">Gaslight Media</a>.</p>';
+ return $text;
+}
+
+add_filter('update_footer', 'right_admin_footer_text_output', 11, true); //right side
+function right_admin_footer_text_output($text) {
+ $text = '';
+ return $text;
+}
+
+add_filter('login_errors','login_error_message');
+
+function login_error_message($error){
+ //check if that's the error you are looking for
+ $pos = strpos($error, 'incorrect');
+ if (is_int($pos)) {
+ //its the right error so you can overwrite it
+ $error = "Invalid Credentials. Please ensure the username and password you entered are correct.";
+ }
+ return $error;
+}
+
+add_action('admin_bar_menu', 'glm_custom_logo');
+
+function glm_custom_logo() {
+ ?>
+ <style type="text/css">
+
+/* #adminmenu .wp-menu-image img {
+ content: url(<?php //echo plugins_url(); ?>/Gaslightify/img/GLM_flame_box_inverted_16x16b.png) !important;
+ }*/
+ #dashboard_activity .no-activity .smiley:before {
+ content: url(<?php echo bloginfo('template_url', __FILE__); ?>/assets/DashboardActivityLogo.png);
+ }
+ #wp-admin-bar-wp-logo > .ab-item .ab-icon:before, #header-logo {
+ content: url(<?php echo plugins_url(); ?>/Gaslightify/img/GLM_flame_none_trans_32x32.png) !important;
+ }
+ #wpadminbar .quicklinks li .blavatar:before {
+ content: url(<?php echo plugins_url(); ?>/Gaslightify/img/GLM_flame_none_trans_16x16.png) !important;
+ }
+
+ </style>
+ <?php
+
+}
+
+add_action('login_form','my_login_logo');
+
+function my_login_logo() { ?>
+ <style type="text/css">
+ // Old dev53 curtain background.
+ /*body.login {
+ background: url(<?php echo plugins_url(); ?>/Gaslightify/img/bg.jpg) repeat scroll 0 0 #f1f1f1
+ }*/
+ .login h1,
+ .login form {
+/* background: url(<?php echo plugins_url(); ?>/Gaslightify/img/body_bg.png) repeat-x scroll 0 0 rgba(0, 0, 0, 0);*/
+ border-radius: 5px;
+ padding-top:10px;
+ }
+ .login #nav {
+ display: none;
+ }
+ #login > h1 > a {
+ background-image: url(<?php echo plugins_url(); ?>/Gaslightify/img/GLM_title_box_272x71.gif);
+ width: auto;
+ background-size: auto;
+ }
+ </style>
+<?php }
+
+function replace_howdy( $wp_admin_bar ) {
+ $my_account=$wp_admin_bar->get_node('my-account');
+ $newtitle = str_replace( 'Howdy,', 'Welcome back,', $my_account->title . "!" );
+ $wp_admin_bar->add_node( array(
+ 'id' => 'my-account',
+ 'title' => $newtitle,
+ ) );
+}
+add_filter( 'admin_bar_menu', 'replace_howdy',25 );
+function glm_stats(){
+ echo '<div class="wrap">
+ <style>
+ #glm_stats {
+ width: 84vw;
+ height: 84vh;
+ }
+ </style>
+ <iframe
+ frameborder="0"
+ width="100%"
+ marginheight="0"
+ marginwidth="0"
+ scrolling="0"
+ src="'.get_site_url().'/stats/"
+ seamless="true"
+ id="glm_stats"></iframe>
+ </div>
+';
+}
+function Gaslightify_menu() {
+ if ( current_user_can( 'edit_others_pages' ) ) {
+ add_menu_page('Server Stats', 'Server Stats', 'edit_posts', 'glm_stats', 'glm_stats', 'dashicons-chart-area');
+ if (class_exists('Ninja_Forms')) {
+ add_menu_page('Form Submissions', 'Form Submissions', 'edit_posts', 'edit.php?post_type=nf_sub', '', 'dashicons-feedback');
+ }
+ }
+}
+add_action('admin_menu', 'Gaslightify_menu');
+/* To give Editors access to the Submissions - Simply replace ‘edit_posts’ in the code snippet below with the capability
+that you would like to attach the ability to view/edit submissions to.Please note that all three filters are needed to
+provide proper submission viewing/editing on the backend!
+*/
+function nf_subs_capabilities( $cap ) {
+ return 'edit_posts';
+}
+add_filter( 'ninja_forms_admin_submissions_capabilities', 'nf_subs_capabilities' );
+add_filter( 'ninja_forms_admin_parent_menu_capabilities', 'nf_subs_capabilities' );
+//add_filter( 'ninja_forms_admin_menu_capabilities', 'nf_subs_capabilities' );
+add_filter('json_enabled', '__return_false');
+add_filter('json_jsonp_enabled', '__return_false');
+?>