Plugin Directory

Changeset 1458008


Ignore:
Timestamp:
07/21/2016 07:18:51 AM (10 years ago)
Author:
djerba
Message:

V 1.5

Location:
facebook-ogg-meta-tags
Files:
20 added
3 edited

Legend:

Unmodified
Added
Removed
  • facebook-ogg-meta-tags/trunk/index.php

    r1452723 r1458008  
    44    Description: Social Meta Tags will generate social media meta data for all new posts that you publish. This allows to share the right titles, descriptions, images and more when your posts are shared into Twitter, Facebook.
    55    Plugin URI: https://wordpress.org/plugins/facebook-ogg-meta-tags/
    6     Version: 1.4
     6    Version: 1.5
    77    Author: Bassem Rabia
    88    Author URI: mailto:bassem.rabia@gmail.com
  • facebook-ogg-meta-tags/trunk/metaTags/metaTags.php

    r1452723 r1458008  
    1212            'pluginNiceName' => 'Social Meta Tags',
    1313            'pluginSlug' => 'social-meta-tags',
    14             'pluginVersion' => '1.0'
     14            'pluginVersion' => '1.5'
    1515        );
     16        add_action('admin_enqueue_scripts', array(&$this, 'admin_enqueue'));
     17        add_action('admin_menu', array(&$this, 'menu'));
    1618        add_action('wp_head', array(&$this, 'init'));   
    1719        add_action('wp_enqueue_scripts', array(&$this, 'enqueue'));
    18         add_action('wp_head', array(&$this, 'run'));
    1920    }
    20 
     21   
     22    public function admin_enqueue(){
     23        wp_enqueue_style($this->Signature['pluginSlug'].'-admin-style', plugins_url('css/'.$this->Signature['pluginSlug'].'-admin.css', __FILE__));
     24        wp_enqueue_script($this->Signature['pluginSlug'].'-admin-script', plugins_url('js/'.$this->Signature['pluginSlug'].'-admin.js', __FILE__));
     25    }
     26   
     27    public function menu(){
     28        add_options_page(
     29            $this->Signature['pluginNiceName'],
     30            $this->Signature['pluginNiceName'],
     31            'manage_options',
     32            strtolower($this->Signature['pluginSlug']).'-main-menu',
     33            array(&$this, 'page')
     34        );
     35        $pluginOptions = get_option($this->Signature['pluginSlug']);
     36        if(count($pluginOptions)==1){
     37            add_option($this->Signature['pluginSlug'], $this->Signature, '', 'yes');
     38        }
     39    }
     40   
     41    public function page(){
     42        ?>
     43        <div class="wrap columns-2 <?php echo $this->Signature['pluginSlug'];?>_wrap">
     44            <div id="<?php echo $this->Signature['pluginSlug'];?>" class="icon32"></div> 
     45            <h2><?php echo $this->Signature['pluginName'] .' '.$this->Signature['pluginVersion']; //echo get_locale();?></h2>           
     46            <div id="poststuff">
     47                <div id="post-body" class="metabox-holder columns-2">
     48                    <div id="postbox-container-1" class="postbox-container <?php echo $this->Signature['pluginSlug'];?>_container">
     49                        <div class="postbox">
     50                            <h3><span><?php _e('User Guide', 'social-meta-tags'); ?></span></h3>
     51                            <div class="inside">
     52                                <ol>
     53                                    <li><?php _e('Install', 'social-meta-tags'); ?></li>
     54                                    <li><?php _e('Run', 'social-meta-tags'); ?></li>
     55                                    <li><?php _e('Enjoy', 'social-meta-tags'); ?></li>
     56                                    <li><?php _e('Ask for Support if you need', 'social-meta-tags'); ?> !</li>
     57                                </ol>
     58                            </div>
     59                        </div>
     60                    </div>                                 
     61                               
     62                    <div id="postbox-container-2" class="postbox-container">
     63                        <div id="<?php echo $this->Signature['pluginSlug'];?>_container">
     64                            <?php   
     65                                $pluginOptions = get_option($this->Signature['pluginSlug']);                               
     66                                // echo '<pre>';print_r($pluginOptions);echo '</pre>';
     67                                if(isset($_POST[$this->Signature['pluginSlug'].'-enabled'])){
     68                                    $pluginOptions['enabled'] = $_POST[$this->Signature['pluginSlug'].'-enabled'];
     69                                    // echo '<pre>';print_r($pluginOptions);echo '</pre>';
     70                                    update_option($this->Signature['pluginSlug'], $pluginOptions);     
     71                                    ?>
     72                                    <div class="accordion-header accordion-notification accordion-notification-success">
     73                                        <i class="fa dashicons dashicons-no-alt"></i>
     74                                        <span class="dashicons dashicons-megaphone"></span>
     75                                        <?php echo $this->Signature['pluginName'];?>
     76                                        <?php echo __('has been successfully updated', 'social-meta-tags');?>.
     77                                    </div> <?php
     78                                    $pluginOptions = get_option($this->Signature['pluginSlug']);                               
     79                                    // echo '<pre>';print_r($pluginOptions);echo '</pre>';
     80                                }
     81                            ?>
     82                            <div class="<?php echo $this->Signature['pluginSlug'];?>_service_content">
     83                                 <div class="accordion-header">
     84                                    <i class="fa dashicons dashicons-arrow-down"></i>
     85                                    <span class="dashicons dashicons-hidden"></span>
     86                                    <?php echo __('Enable Scoial Buttons', 'social-meta-tags');?>
     87                                </div>     
     88                                <div class="<?php echo $this->Signature['pluginSlug'];?>_service_content <?php echo $this->Signature['pluginSlug'];?>_service_content_active">
     89                                    <form method="POST" action="" />
     90                                        <input <?php echo (!isset($pluginOptions['enabled']) || $pluginOptions['enabled'] == 1)?'checked':'';?> type="radio" name="<?php echo $this->Signature['pluginSlug'];?>-enabled" value="1" /> <?php echo __('Enable', 'social-meta-tags');?>
     91                                        <input <?php echo ($pluginOptions['enabled'] == 0)?'checked':'';?> type="radio" name="<?php echo $this->Signature['pluginSlug'];?>-enabled" value="0" /> <?php echo __('Disable', 'social-meta-tags');?>
     92                                       
     93                                        <input class="<?php echo $this->Signature['pluginSlug'];?>_submit" type="submit" value="<?php echo __('Save', 'social-meta-tags');?>" />   
     94                                        <div class="clear"></div>
     95                                    </form>
     96                                </div>
     97                            </div>                         
     98                        </div>
     99                    </div>
     100                </div>
     101            </div>
     102        </div>
     103        <?php
     104    }
     105   
    21106    public function enqueue(){
    22107        wp_enqueue_style($this->Signature['pluginSlug'].'-front-style', plugins_url('css/'.$this->Signature['pluginSlug'].'-front.css', __FILE__));     
     
    25110
    26111    public function init(){
     112        $pluginOptions = get_option($this->Signature['pluginSlug']);                               
     113        // echo '<p&re>';print_r($pluginOptions);echo '</pre>';
     114                               
    27115        $url = plugin_dir_url(__FILE__).'/images/512.png';
    28116        if(has_post_thumbnail())
     
    51139        <!-- ------------------ -->
    52140        <?php
    53     }
    54    
    55     public function run(){
    56         if(is_single() AND get_post_type() == 'post'){
     141        // echo $pluginOptions['enabled'];
     142        if(is_single() AND get_post_type() == 'post' AND $pluginOptions['enabled'] == 1){
    57143            function my_metaTags($content){
    58144                global $post;       
     
    79165            // self::get();
    80166        }
     167       
    81168    }
    82169}   
  • facebook-ogg-meta-tags/trunk/readme.txt

    r1452728 r1458008  
    55Requires at least: 3.4.0
    66Tested up to: 4.5.3
    7 Stable tag: 1.4
     7Stable tag: 1.5
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2424== Screenshots ==
    2525
    26 1. Social Meta Tags
     261. Social Meta Tags - front web site
     271. Social Meta Tags - admin panel
    2728
    2829== Upgrade Notice ==
    2930
     31= 1.5 =
    3032= 1.4 =
    3133= 1.3.1 =
     
    3638
    3739== Changelog ==
     40
     41= 1.5 =
     42* Enable  - disable share buttons into post page
    3843
    3944= 1.4 =
Note: See TracChangeset for help on using the changeset viewer.