Skip to content

Commit

Permalink
* Add uninstall.
Browse files Browse the repository at this point in the history
 * Update azurecurve menu and logo.
  • Loading branch information
azurecurve committed May 15, 2021
1 parent c49ed5d commit a3f08d5
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 9 deletions.
19 changes: 12 additions & 7 deletions azrcrv-nearby.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* ------------------------------------------------------------------------------
* Plugin Name: Nearby
* Description: Creates table of nearby locations based on GPS co-ordinates.
* Version: 2.4.4
* Version: 2.5.0
* Author: azurecurve
* Author URI: https://development.azurecurve.co.uk/classicpress-plugins/
* Plugin URI: https://development.azurecurve.co.uk/classicpress-plugins/nearby/
Expand Down Expand Up @@ -493,7 +493,12 @@ function azrcrv_n_display_options(){
?>
<div id="azrcrv-n-general" class="wrap">
<fieldset>
<h1><?php echo esc_html(get_admin_page_title()); ?></h1>
<h1>
<?php
echo '<a href="https://development.azurecurve.co.uk/classicpress-plugins/"><img src="'.plugins_url('/pluginmenu/images/logo.svg', __FILE__).'" style="padding-right: 6px; height: 20px; width: 20px;" alt="azurecurve" /></a>';
esc_html_e(get_admin_page_title());
?>
</h1>
<?php if(isset($_GET['settings-updated'])){ ?>
<div class="notice notice-success is-dismissible">
<p><strong><?php esc_html_e('Settings have been saved.', 'nearby'); ?></strong></p>
Expand Down Expand Up @@ -533,9 +538,9 @@ function azrcrv_n_display_options(){
?>

<h2 class="nav-tab-wrapper nav-tab-wrapper-azrcrv-n">
<a class="nav-tab <?php echo $tab1active; ?>" data-item=".tabs-1" href="#tabs-1"><?php _e('Default Settings', 'nearby') ?></a>
<a class="nav-tab" data-item=".tabs-2" href="#tabs-2"><?php _e('Integration', 'nearby') ?></a>
<a class="nav-tab <?php echo $tab3active; ?>" data-item=".tabs-3" href="#tabs-3"><?php _e('Types', 'nearby') ?></a>
<a class="nav-tab <?php echo $tab1active; ?>" data-item=".tabs-1" href="#tabs-1"><?php esc_html_e('Default Settings', 'nearby') ?></a>
<a class="nav-tab" data-item=".tabs-2" href="#tabs-2"><?php esc_html_e('Integration', 'nearby') ?></a>
<a class="nav-tab <?php echo $tab3active; ?>" data-item=".tabs-3" href="#tabs-3"><?php esc_html_e('Types', 'nearby') ?></a>
</h2>

<div>
Expand Down Expand Up @@ -876,9 +881,9 @@ function azrcrv_n_display_options(){
echo '<input type="hidden" name="azrcrv_n_delete_type" value="yes" />';
echo '</form>';
}
echo '<p class="description">'.__('Types assigned to pages or set as defaults cannot be deleted.', 'nearby').'</p>';
echo '<p class="description">'.esc_html__('Types assigned to pages or set as defaults cannot be deleted.', 'nearby').'</p>';
}else{
echo __('No types have been added.', 'nearby');
echo esc_html__('No types have been added.', 'nearby');
}
?>
</td>
Expand Down
14 changes: 14 additions & 0 deletions pluginmenu/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,27 @@ function azrcrv_populate_plugin_menu_n(){
'retired' => 0,
'updated' => '2020-04-04',
),
'Check Plugin Status' => array(
'plugin_link' => 'azrcrv-check-plugin-status/azrcrv-check-plugin-status.php',
'admin_URL' => 'admin.php?page=azrcrv-check-plugin-status',
'dev_URL' => 'https://development.azurecurve.co.uk/classicpress-plugins/check-plugin-status/',
'retired' => 0,
'updated' => '2020-02-23',
),
'Code' => array(
'plugin_link' => 'azrcrv-code/azrcrv-code.php',
'admin_URL' => 'admin.php?page=azrcrv-c',
'dev_URL' => 'https://development.azurecurve.co.uk/classicpress-plugins/code/',
'retired' => 0,
'updated' => '2020-04-04',
),
'Check Plugin Status' => array(
'plugin_link' => 'azrcrv-check-plugin-status/azrcrv-check-plugin-status.php',
'admin_URL' => 'admin.php?page=azrcrv-cps',
'dev_URL' => 'https://development.azurecurve.co.uk/classicpress-plugins/check-plugin-status/',
'retired' => 0,
'updated' => '2021-01-11',
),
'Comment Validator' => array(
'plugin_link' => 'azrcrv-comment-validator/azrcrv-comment-validator.php',
'admin_URL' => 'admin.php?page=azrcrv-cv',
Expand Down
8 changes: 6 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
=== Nearby ===

Description: Creates table of nearby locations based on GPS co-ordinates.
Version: 2.4.4
Version: 2.5.0
Tags: location,gps
Author: azurecurve
Author URI: https://development.azurecurve.co.uk/
Plugin URI: https://development.azurecurve.co.uk/classicpress-plugins/nearby/
Download link: https://github.com/azurecurve/azrcrv-nearby/releases/download/v2.4.4/azrcrv-nearby.zip
Download link: https://github.com/azurecurve/azrcrv-nearby/releases/download/v2.5.0/azrcrv-nearby.zip
Donate link: https://development.azurecurve.co.uk/support-development/
Requires PHP: 5.6
Requires: 1.0.0
Expand Down Expand Up @@ -67,6 +67,10 @@ This plugin is developed for ClassicPress, but will likely work on WordPress.

# Changelog

### [Version 2.5.0](https://github.com/azurecurve/azrcrv-nearby/releases/tag/v2.5.0)
* Add uninstall.
* Update azurecurve menu and logo.

### [Version 2.4.4](https://github.com/azurecurve/azrcrv-nearby/releases/tag/v2.4.4)
* Fix bug with version number.

Expand Down
41 changes: 41 additions & 0 deletions uninstall.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
// Check that code was called from ClassicPress with uninstallation constant declared
if (! defined('WP_UNINSTALL_PLUGIN')){
exit;
}

// Options to remove
$options = array(
'azrcrv-n'
);

// Remove from single site
if (! is_multisite()){

foreach ($options as $option){
delete_option($option);
}

}
// Remove from multi site
else {
global $wpdb;

$blog_ids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
$original_blog_id = get_current_blog_id();

foreach ($blog_ids as $blog_id){
switch_to_blog($blog_id);

foreach ($options as $option){
delete_option($option);
}
}

switch_to_blog($original_blog_id);

foreach ($options as $option){
delete_site_option($option);
}
}
?>

0 comments on commit a3f08d5

Please sign in to comment.