Plugin Directory

Changeset 2156202


Ignore:
Timestamp:
09/13/2019 03:30:41 PM (7 years ago)
Author:
writup
Message:

Version 1.2.0

Location:
wp-writup
Files:
34 added
23 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • wp-writup/trunk/_inc/index.php

    r1725676 r2156202  
    11<?php
    2 // Silence is golden.
     2    // Silence is golden.
    33?>
  • wp-writup/trunk/index.php

    r1725676 r2156202  
    11<?php
    2 // Silence is golden.
    3 ?>
     2    // Silence is golden.
     3?> 
  • wp-writup/trunk/languages/index.php

    r1725676 r2156202  
    11<?php
    2 // Silence is golden.
     2    // Silence is golden.
    33?>
  • wp-writup/trunk/wpwritup.php

    r1916055 r2156202  
    11<?php
    22/*
    3 Plugin Name: WP WritUp
    4 Plugin URI: https://wp-writup.fr
    5 Description: Le compagnon idéal pour la rédaction de vos pages de contenu WordPress.
    6 Author: Dailycom Agency.
    7 Version: 1.1.9
    8 Text Domain: wp-writup
    9 Domain Path: /languages/
    10 */ 
     3 * Plugin Name:  WP Writup
     4 * Plugin URI:   https://wp-writup.fr
     5 * Description:  WP Writup becomes rank4win, powerful, with new tools. Available in the plugins library, we invite you to download it. When rank4win is activated this plugin is automatically disabled.
     6 * Version:      1.2.0
     7 * Author:       WP Writup
     8 * Author URI:   https://wp-writup.fr
     9 * Text Domain:  app_wpwritup
     10 * Domain Path:  /languages/
     11*/
    1112
    12 /**
    13  * I LOVE WORDPRESS
    14  */
    15 global $wpdb;
     13    /**
     14     *  Quitter si on y accède directement
     15     */
     16        if ( ! defined( 'ABSPATH' ) ) {
     17            exit;
     18        }
    1619
    17 /**
    18  * Returns current plugin version.
    19  * @return string Plugin version
    20  */
    21 function WPW_get_version() {
    22     if ( ! function_exists( 'get_plugins' ) )
    23         require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
    24     $plugin_folder = get_plugins( '/' . plugin_basename( dirname( __FILE__ ) ) );
    25     $plugin_file = basename( ( __FILE__ ) );
    26     return $plugin_folder[$plugin_file]['Version'];
    27 }
    28 // Récupération des indispensable
    29 require_once dirname( __FILE__ ) . '/_inc/init.php';
    30 $Cleaning = 'xed25';
    31 WPW_get_define( WPW_get_version(), $Cleaning );
     20    /**
     21     * Récupération des constante définit
     22     */
     23        require_once("_inc/config.php");
    3224
    33 // Activate, Disabled
    34 register_activation_hook( __FILE__, 'WPWriting_activation' );
    35 register_deactivation_hook ( __FILE__, 'WPWriting_desactivation' );
    36 /**
    37  * START ACTION
    38  */
     25    /**
     26     * Récupération automatique des fonctions
     27     */
     28        foreach (glob( dirname(__FILE__)."/_inc/fcnt/fcnt.*.php") as $require_file) {
     29            if (is_file($require_file)) {
     30                require_once($require_file);
     31            }
     32        }
    3933
    40 add_action( 'plugins_loaded', 'WPWriting_init' );
    41 add_action( 'wpmu_new_blog', 'WPWriting_CreateBlog', 10, 6 );
    42 add_filter( 'wpmu_drop_tables', 'WPWriting_RemoveBlog' );
    43 add_action( 'admin_print_styles-post-new.php', 'wpw_enqueue' );
    44 add_action( 'admin_print_styles-post.php', 'wpw_enqueue' );
    45 add_action( 'edit_form_top', 'wpw_box_top' );
    46 add_filter( 'tiny_mce_before_init', 'wpw_mce_init' );
    47 add_filter( 'script_loader_tag', 'wpw_add_attribute', 10, 3 );
    48 add_filter( 'mce_css', 'wpw_editor_style' );
    49 add_action( 'wp_head', 'wpw_metatags', 1);
    50 add_filter( 'document_title_parts', 'wpw_metatitle' );
    51 add_action( 'wp_ajax_wpw_update_act', 'wpw_update_act' );
    52 add_action( 'wp_ajax_wpw_update_acc', 'wpw_update_acc' );
    53 add_action( 'wp_ajax_wpw_update_acs', 'wpw_update_acs' );
    54 add_action( 'wp_ajax_wpw_update_dls', 'wpw_update_dls' );
    55 add_action( 'wp_ajax_wpw_update_clhlp', 'wpw_update_clhlp' );
    56 add_action( 'admin_enqueue_scripts', 'wpw_setting_style' );
    57 add_action( 'admin_enqueue_scripts', 'wpw_subscribes_style' );
    58 add_filter( 'manage_posts_columns', 'wpw_posts_columns', 10, 2 );
    59 add_action( 'manage_posts_custom_column', 'wpw_posts_columns_contenu', 10, 2 );
    60 add_filter( 'manage_pages_columns', 'wpw_pages_columns', 10 );
    61 add_action( 'manage_pages_custom_column', 'wpw_posts_columns_contenu', 10, 2 );
    62 add_action('admin_head', 'wpw_style_admin');
    63 /**
    64  * LOAD LANGUAGE
    65  */
    66 function WPWriting_init(){
    67     global $WPWriting;
    68     load_plugin_textdomain ( 'wp-writup', false, basename(rtrim(dirname(__FILE__), '/')) . '/languages' );
    69 }
    70 /**
    71  * ACTIVATING THE PLUGIN
    72  */
    73 function WPWriting_activation($network_wide) {
    74     global $wpdb;
    75     if ( is_multisite() && $network_wide ) {
    76         $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
    77         foreach ( $blog_ids as $blog_id ) {
    78             switch_to_blog( $blog_id );
    79             WPWriting_CreateTable();
    80             restore_current_blog();
     34    /**
     35     * Récupération automatique des class
     36     */
     37        foreach (glob( dirname(__FILE__)."/_inc/class/class.*.php") as $require_file) {
     38            if (is_file($require_file)) {
     39                require_once($require_file);
     40            }
    8141        }
    82     } else {
    83         WPWriting_CreateTable();
    84     }
    85 }
    86 /**
    87  * DEACTIVATION THE PLUGIN
    88  */
    89 function WPWriting_desactivation() {
    90     global $wpdb;
    91     if ( is_multisite() && $network_wide ) {
    92         $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
    93         foreach ( $blog_ids as $blog_id ) {
    94             switch_to_blog( $blog_id );
    95             WPWriting_DelectTable();
    96             restore_current_blog();
    97         }
    98     } else {
    99         WPWriting_DelectTable();
    100     }
    101 }
    102 /**
    103  * CREATING THE DATABASE
    104  */
    105 function WPWriting_CreateTable(){
    106     global $wpdb;
    107     $wpw_db = $wpdb->prefix."wp_writup";
    108     if($wpdb->get_var("show tables like '{$wpw_db}'") != $wpw_db)
    109     {       
    110         $wpw_sql_creat = "CREATE TABLE " . $wpw_db . " (`id` mediumint(9) NOT NULL AUTO_INCREMENT,`license` text,`agreement` text,`wpkey` text,`path` text,`install` text,`registration` text, `wpw_ukey` text, `wpw_token` text, `wpw_help` char(1), UNIQUE KEY id (id));";
    111         $wpdb->query($wpw_sql_creat);
    112         $wpw_install = wpw_genrandom_string(18);     
    113         $wpdb->query($wpdb->prepare("INSERT INTO $wpw_db (id,license,agreement,wpkey,path,install,wpw_ukey,wpw_token,wpw_help) VALUES(%d,%s,%s,%s,%s,%s,%s,%s,%d)", array(1,'','','','',$wpw_install,'','',1)));
    114     } 
    115 }
    116 /**
    117  * DELECT THE DATABASE
    118  */
    119 function WPWriting_DelectTable(){
    120     global $wpdb;
    121     $wpw_table = $wpdb->prefix."wp_writup";
    122     $sql = "DROP TABLE IF EXISTS " . $wpw_table. ";";
    123     $wpdb->query($sql);
    124 }
    125 /**
    126  * ADDING A NEW BLOG
    127  */
    128 function WPWriting_CreateBlog(){
    129     if(is_plugin_active_for_network( 'plugin-name/plugin-name.php')){
    130         switch_to_blog($blog_id);
    131         WPWriting_CreateTable();
    132         restore_current_blog();
    133     }
    134 }
    135 /**
    136  * REMOVE A BLOG
    137  */
    138 function WPWriting_RemoveBlog($wpw_table) {
    139     global $wpdb;
    140     $wpw_table[] = $wpdb->prefix.'wp_writup';
    141     return $wpw_table;
    142 }
    143 /**
    144  * SOLVE PROBLEMES AUTOMATICALLY
    145  */
    146 function WPWriting_SolveProblemsAuto()
    147 {
    148     WPWriting_desactivation();
    149     WPWriting_activation($network_wide);
    150     return true;
    151 }
    152 
    153 
    154 
Note: See TracChangeset for help on using the changeset viewer.