Plugin Directory

Changeset 1007465


Ignore:
Timestamp:
10/14/2014 06:03:38 PM (11 years ago)
Author:
radiok
Message:

Minor stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • register-plus-redux/trunk/register-plus-redux.php

    r1003367 r1007465  
    66Plugin URI: http://radiok.info/blog/category/register-plus-redux/
    77Description: Enhances the user registration process with complete customization and additional administration options.
    8 Version: 4.0.3
     8Version: 4.0.4
    99Text Domain: register-plus-redux
    1010Domain Path: /languages
     
    2727// TODO: Enhancement- Widget is lame/near worthless
    2828
    29 define( 'RPR_VERSION', '4.0.3' );
     29define( 'RPR_VERSION', '4.0.4' );
    3030define( 'RPR_ACTIVATION_REQUIRED', '3.9.6' );
    3131
     
    619619    }
    620620}
    621 if( file_exists(plugin_dir_path( __FILE__ ).'/readygraph-extension.php' ) ) {
    622         include "readygraph-extension.php";
     621
     622if ( file_exists( plugin_dir_path( __FILE__ ) . 'readygraph-extension.php' ) ) {
     623    include_once( plugin_dir_path( __FILE__ ) . 'readygraph-extension.php' );
    623624}
    624 function rpr_delete_rg_options() {
    625     delete_option('readygraph_access_token');
    626     delete_option('readygraph_application_id');
    627     delete_option('readygraph_refresh_token');
    628     delete_option('readygraph_email');
    629     delete_option('readygraph_settings');
    630     delete_option('readygraph_delay');
    631     delete_option('readygraph_enable_sidebar');
    632     delete_option('readygraph_auto_select_all');
    633     delete_option('readygraph_enable_notification');
    634     delete_option('readygraph_enable_branding');
    635     delete_option('readygraph_send_blog_updates');
    636     delete_option('readygraph_send_real_time_post_updates');
    637     delete_option('readygraph_popup_template');
     625
     626/*.void.*/ function rpr_delete_rg_options() {
     627    delete_option( 'readygraph_access_token' );
     628    delete_option( 'readygraph_application_id' );
     629    delete_option( 'readygraph_refresh_token' );
     630    delete_option( 'readygraph_email' );
     631    delete_option( 'readygraph_settings' );
     632    delete_option( 'readygraph_delay' );
     633    delete_option( 'readygraph_enable_sidebar' );
     634    delete_option( 'readygraph_auto_select_all' );
     635    delete_option( 'readygraph_enable_notification' );
     636    delete_option( 'readygraph_enable_branding' );
     637    delete_option( 'readygraph_send_blog_updates' );
     638    delete_option( 'readygraph_send_real_time_post_updates' );
     639    delete_option( 'readygraph_popup_template' );
    638640}
    639 function rpr_rrmdir($dir) {
    640       if (is_dir($dir)) {
    641         $objects = scandir($dir);
    642         foreach ($objects as $object) {
    643           if ($object != "." && $object != "..") {
    644             if (filetype($dir."/".$object) == "dir")
    645                rpr_rrmdir($dir."/".$object);
    646             else unlink   ($dir."/".$object);
    647           }
    648         }
    649         reset($objects);
    650         rmdir($dir);
    651       }
    652       $del_url = plugin_dir_path( __FILE__ );
    653       unlink($del_url.'/readygraph-extension.php');
    654      $setting_url="admin.php?page=register-plus-redux";
    655       echo'<script> window.location="'.admin_url($setting_url).'"; </script> ';
     641
     642/*.void.*/ function rpr_rrmdir( /*.string.*/ $dir ) {
     643    $dir = untrailingslashit( $dir ); //not essential, but technically correct- radiok
     644    if ( is_dir( $dir ) ) {
     645        /*.array[]string.*/ $objects = scandir( $dir );
     646        foreach ( $objects as $object ) {
     647            if ( $object !== '.' && $object !== '..' ) {
     648                if ( is_dir( $dir . '/' . $object ) ) { // use boolean function over a filetype equality statement- radiok
     649                    rpr_rrmdir( $dir . '/' . $object );
     650                }
     651                else {
     652                    unlink( $dir . '/' . $object );
     653                }
     654            }
     655        }
     656        // reset( $objects ); // when foreach first starts executing, the internal array pointer is automatically reset to the first element of the array [http://php.net/manual/en/control-structures.foreach.php]- radiok
     657        rmdir( $dir );
     658    }
     659    unlink( plugin_dir_path( __FILE__ ) . 'readygraph-extension.php' );
     660    echo '<script>window.location="' . admin_url( 'admin.php?page=register-plus-redux' ) . '";</script>';
    656661}
    657662
Note: See TracChangeset for help on using the changeset viewer.