Plugin Directory

Changeset 2990491

Timestamp:
11/07/2023 07:00:01 AM (9 months ago)
Author:
Atlas_Gondal
Message:

support for language translation, code refinements and compatibility test with wordpress 6.4

Location:
export-all-urls
Files:
25 added
3 edited

Legend:

Unmodified
Added
Removed
  • export-all-urls/trunk/extract-all-urls-settings.php

    r2926489 r2990491  
    11<?php
    2 require_once(plugin_dir_path(__FILE__) . 'functions.php');
     2
     3namespace Export_All_URLs;
     4
     5defined('ABSPATH') || exit;
     6
     7require_once(plugin_dir_path(__FILE__) . 'classes/constants.php');
     8require_once(plugin_dir_path(__FILE__) . '/eau_functions.php');
    39
    410/**
     11
    512 *
     13
    614 */
    715function eau_generate_html()
    816{
     17
    918
    1019    if (!current_user_can('manage_options')) {
     
    5867    }
    5968
    60     $export_fields = eau_export_fields();
     69    $export_fields = xport_fields();
    6170
    6271    $form_submitted = isset($_POST['form_submitted']) ? true : false;
     
    7483    <div class="wrap">
    7584
    76         <h2 align="center">Export Data from your Site</h2>
     85        <h2 align="center"></h2>
    7786
    7887        <div class="eauWrapper">
     
    8796                            <tr>
    8897
    89                                 <th>Select a Post Type to Extract Data: </th>
     98                                <th> </th>
    9099
    91100                                <td>
     
    101110                            <tr>
    102111
    103                                 <th>Export Fields:</th>
     112                                <th></th>
    104113
    105114                                <td>
     
    115124                            <tr>
    116125
    117                                 <th>Post Status:</th>
     126                                <th></th>
    118127
    119128                                <td>
     
    129138                            <tr>
    130139                                <th></th>
    131                                 <td><a href="#" id="moreFilterOptionsLabel" onclick="moreFilterOptions(); return false;">Show Filter Options</a></td>
     140                                <td><a href="#" id="moreFilterOptionsLabel" onclick="moreFilterOptions(); return false;"></a></td>
    132141                            </tr>
    133142
    134143                            <tr class="filter-options" style="display: none">
    135144
    136                                 <th>Date Range:</th>
    137 
    138                                 <td>
    139 
    140                                     <label>From:<input type="date" id="posts-from" name="posts-from" onmouseleave="setMinValueForPostsUptoField()" onfocusout="setMinValueForPostsUptoField()" /></label>
    141                                     <label>To:<input type="date" id="posts-upto" name="posts-upto" /></label><br />
     145                                <th></th>
     146
     147                                <td>
     148
     149                                    <label><input type="date" id="posts-from" name="posts-from" onmouseleave="setMinValueForPostsUptoField()" onfocusout="setMinValueForPostsUptoField()" /></label>
     150                                    <label><input type="date" id="posts-upto" name="posts-upto" /></label><br />
    142151
    143152
     
    148157                            <tr class="filter-options" style="display: none">
    149158
    150                                 <th>By Author:</th>
     159                                <th></th>
    151160
    152161                                <td>
     
    162171                            <tr>
    163172                                <th></th>
    164                                 <td><a href="#" id="advanceOptionsLabel" onclick="showAdvanceOptions(); return false;">Show
    165                                         Advanced Options</a></td>
     173                                <td><a href="#" id="advanceOptionsLabel" onclick="showAdvanceOptions(); return false;"><?php echo esc_html__('Show Advanced Options', Constants::PLUGIN_TEXT_DOMAIN); ?></a></td>
    166174                            </tr>
    167175
     
    169177                            <tr class="advance-options" style="display: none">
    170178
    171                                 <th>Exclude Domain URL: </th>
    172 
    173                                 <td>
    174 
    175                                     <label><input type="checkbox" name="exclude-domain" value="yes" <?php echo isset($_POST['exclude-domain']) ? 'checked' : ''; ?> /> Yes &nbsp;&nbsp;<code>Enable this option to remove the domain from URLs, e.g., 'example.com/sample-post/' becomes '/sample-post/</code>
     179                                <th> </th>
     180
     181                                <td>
     182
     183                                    <label><input type="checkbox" name="exclude-domain" value="yes" <?php echo isset($_POST['exclude-domain']) ? 'checked' : ''; ?> /> </code>
    176184
    177185                                </td>
     
    181189                            <tr class="advance-options" style="display: none">
    182190
    183                                 <th>Number of Posts: <a href="#" title="Specify Post Range to Extract, It is very useful in case of Memory Out Error!" onclick="return false">?</a></th>
    184 
    185                                 <td>
    186 
    187                                     <label><input type="radio" name="number-of-posts" checked value="all" required="required" onclick="hideRangeFields()" /> All</label><br />
    188                                     <label><input type="radio" name="number-of-posts" value="range" required="required" onclick="showRangeFields()" /> Specify Range</label><br />
     191                                <th>" onclick="return false">?</a></th>
     192
     193                                <td>
     194
     195                                    <label><input type="radio" name="number-of-posts" checked value="all" required="required" onclick="hideRangeFields()" /> </label><br />
     196                                    <label><input type="radio" name="number-of-posts" value="range" required="required" onclick="showRangeFields()" /> </label><br />
    189197
    190198                                    <div id="postRange" style="display: none">
    191                                         From: <input type="number" name="starting-point" placeholder="0" value="<?php echo isset($_POST['starting-point']) ? esc_attr($_POST['starting-point']) : ''; ?>">
    192                                         To: <input type="number" name="ending-point" placeholder="500" value="<?php echo isset($_POST['ending-point']) ? esc_attr($_POST['ending-point']) : ''; ?>">
     199                                        <input type="number" name="starting-point" placeholder="0" value="<?php echo isset($_POST['starting-point']) ? esc_attr($_POST['starting-point']) : ''; ?>">
     200                                        <input type="number" name="ending-point" placeholder="500" value="<?php echo isset($_POST['ending-point']) ? esc_attr($_POST['ending-point']) : ''; ?>">
    193201                                    </div>
    194202
     
    199207                            <tr class="advance-options" style="display: none">
    200208
    201                                 <th>CSV File Name: </th>
    202 
    203                                 <td>
    204 
    205                                     <label><input type="text" name="csv-file-name" placeholder="An Error Occured" value="<?php echo $file_name; ?>" size="30%" /></label><br />
     209                                <th> </th>
     210
     211                                <td>
     212
     213                                    <label><input type="text" name="csv-file-name" placeholder="" value="<?php echo $file_name; ?>" size="30%" /></label><br />
    206214                                    <code><?php echo $file_path['path']; ?></code>
    207215
     
    214222                            <tr>
    215223
    216                                 <th>Export Type:</th>
     224                                <th></th>
    217225
    218226                                <td>
     
    231239
    232240                                <td>
    233                                     <input type="submit" name="export" class="button button-primary" value="Export Now" />
     241                                    <input type="submit" name="export" class="button button-primary" value="" />
    234242                                </td>
    235243
     
    248256            <div id="eauSideContainer" class="eaucolumns">
    249257                <div class="postbox">
    250                     <h3>Want to Support?</h3>
     258                    <h3></h3>
    251259                    <div class="inside">
    252                         <p>If you enjoyed the plugin, and want to support:</p>
     260                        <p></p>
    253261                        <ul>
    254262                            <li>
    255                                 <a href="https://AtlasGondal.com/contact-me/?utm_source=self&utm_medium=wp&utm_campaign=export-all-urls&utm_term=hire-me" target="_blank">Hire me</a> on a project
     263                                <a href="https://AtlasGondal.com/contact-me/?utm_source=self&utm_medium=wp&utm_campaign=export-all-urls&utm_term=hire-me" target="_blank">
    256264                            </li>
    257                             <li>Buy me a Coffee
     265                            <li>
    258266                                <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YWT3BFURG6SGS&source=url" target="_blank"><img src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" /> </a>
    259267
     
    261269                        </ul>
    262270                        <hr>
    263                         <h3>Wanna say Thanks?</h3>
     271                        <h3></h3>
    264272                        <ul>
    265                             <li>Leave <a href="https://wordpress.org/support/plugin/export-all-urls/reviews/?filter=5#new-post" target="_blank">&#9733;&#9733;&#9733;&#9733;&#9733;</a> rating
     273                            <li>
    266274                            </li>
    267                             <li>Tweet me: <a href="https://twitter.com/atlas_gondal" target="_blank">@Atlas_Gondal</a>
     275                            <li> <a href="https://twitter.com/atlas_gondal" target="_blank">@Atlas_Gondal</a>
    268276                            </li>
    269277                        </ul>
    270278                        <hr>
    271                         <h3>Got a Problem?</h3>
    272                         <p>If you want to report a bug or suggest new feature. You can:</p>
     279                        <h3></h3>
     280                        <p></p>
    273281                        <ul>
    274                             <li>Create <a href="https://wordpress.org/support/plugin/export-all-urls/" target="_blank">Support
    275                                     Ticket</a></li>
    276 
    277                             <li>Write me an <a href="https://AtlasGondal.com/contact-me/?utm_source=self&utm_medium=wp&utm_campaign=export-all-urls&utm_term=write-an-email" target="_blank">Email</a></li>
     282                            <li><?php echo esc_html__('Create', Constants::PLUGIN_TEXT_DOMAIN); ?> <a href="https://wordpress.org/support/plugin/export-all-urls/" target="_blank"><?php echo esc_html__('Support Ticket', Constants::PLUGIN_TEXT_DOMAIN); ?></a></li>
     283
     284                            <li><?php echo esc_html__('Write me an', Constants::PLUGIN_TEXT_DOMAIN); ?> <a href="https://AtlasGondal.com/contact-me/?utm_source=self&utm_medium=wp&utm_campaign=export-all-urls&utm_term=write-an-email" target="_blank"><?php echo esc_html__('Email', Constants::PLUGIN_TEXT_DOMAIN); ?></a></li>
    278285                        </ul>
    279                         <strong>Reporting</strong> an issue is more effective than giving a <strong>1 star</strong> review, as it aids you, me, and the entire community. Kindly consider letting me help prior to leaving negative feedback.
     286                        <strong>
    280287                        <hr>
    281                         <h4 id="eauDevelopedBy">Developed by: <a href="https://AtlasGondal.com/?utm_source=self&utm_medium=wp&utm_campaign=export-all-urls&utm_term=developed-by" target="_blank">Atlas Gondal</a></h4>
     288                        <h4 id="eauDevelopedBy"> <a href="https://AtlasGondal.com/?utm_source=self&utm_medium=wp&utm_campaign=export-all-urls&utm_term=developed-by" target="_blank">Atlas Gondal</a></h4>
    282289                    </div>
    283290                </div>
    284291            </div>
    285292        </div>
    286 
    287         <style>
    288             .eauWrapper {
    289                 display: -webkit-flex;
    290                 display: -ms-flexbox;
    291                 display: flex;
    292                 -webkit-flex-wrap: wrap;
    293                 -ms-flex-wrap: wrap;
    294                 flex-wrap: wrap;
    295                 overflow: hidden
    296             }
    297 
    298             #eauMainContainer {
    299                 width: 75%;
    300                 margin-bottom: 0
    301             }
    302 
    303             #eauSideContainer {
    304                 width: 24%
    305             }
    306 
    307             #eauSideContainer .postbox:first-child {
    308                 margin-left: 20px;
    309                 padding-top: 10%;
    310                 display: grid;
    311             }
    312 
    313             .eaucolumns {
    314                 float: left;
    315                 display: -webkit-flex;
    316                 display: -ms-flexbox;
    317                 display: flex;
    318                 margin-top: 5px
    319             }
    320 
    321             #eauSideContainer .postbox {
    322                 margin-bottom: 0;
    323                 float: none
    324             }
    325 
    326             #eauSideContainer .inside {
    327                 margin-bottom: 0
    328             }
    329 
    330             #eauSideContainer hr {
    331                 width: 70%;
    332                 margin: 30px auto
    333             }
    334 
    335             #eauSideContainer h3 {
    336                 cursor: default;
    337                 text-align: center;
    338                 font-size: 16px
    339             }
    340 
    341             #eauSideContainer li {
    342                 list-style: disclosure-closed;
    343                 margin-left: 25px
    344             }
    345 
    346             #eauSideContainer li a img {
    347                 display: inline-block;
    348                 vertical-align: middle
    349             }
    350 
    351             #eauDevelopedBy {
    352                 text-align: center
    353             }
    354 
    355             #outputData {
    356                 border-collapse: collapse;
    357                 width: 98%
    358             }
    359 
    360             #outputData tr:nth-child(even) {
    361                 background-color: #fff
    362             }
    363 
    364             #outputData tr:hover {
    365                 background-color: #ddd
    366             }
    367 
    368             #outputData th {
    369                 background-color: #000;
    370                 color: #fff;
    371                 font-weight: bold;
    372             }
    373 
    374             #outputData td,
    375             #outputData th {
    376                 text-align: left;
    377                 padding: 8px
    378             }
    379 
    380             #outputData th:first-child {
    381                 width: 4%
    382             }
    383 
    384             #outputData #postID {
    385                 width: 6%
    386             }
    387 
    388             #outputData #postTitle {
    389                 width: 25%
    390             }
    391 
    392             #outputData #postURL {
    393                 width: 45%
    394             }
    395 
    396             #outputData #postCategories {
    397                 width: 20%
    398             }
    399 
    400             #eauMainContainer code {
    401                 font-size: 11px;
    402                 background-color: #eee;
    403                 padding-left: 5px;
    404                 padding-right: 5px;
    405             }
    406         </style>
    407 
    408         <script type="text/javascript">
    409             function showRangeFields() {
    410                 document.getElementById('postRange').style.display = 'block';
    411             }
    412 
    413             function hideRangeFields() {
    414                 document.getElementById('postRange').style.display = 'none';
    415             }
    416 
    417             function showAdvanceOptions() {
    418 
    419                 var rows = document.getElementsByClassName('advance-options');
    420 
    421                 for (var i = 0; i < rows.length; i++) {
    422                     rows[i].style.display = 'table-row';
    423                 }
    424 
    425                 document.getElementById('advanceOptionsLabel').innerHTML = "Hide Advanced Options";
    426                 document.getElementById('advanceOptionsLabel').setAttribute("onclick", "javascript: hideAdvanceOptions(); return false;");
    427 
    428             }
    429 
    430             function hideAdvanceOptions() {
    431 
    432                 var rows = document.getElementsByClassName('advance-options');
    433 
    434                 for (var i = 0; i < rows.length; i++) {
    435                     rows[i].style.display = 'none';
    436                 }
    437 
    438                 document.getElementById('advanceOptionsLabel').innerHTML = "Show Advanced Options";
    439                 document.getElementById('advanceOptionsLabel').setAttribute("onclick", "javascript: showAdvanceOptions(); return false;");
    440 
    441             }
    442 
    443             function moreFilterOptions() {
    444                 var rows = document.getElementsByClassName('filter-options');
    445 
    446                 for (var i = 0; i < rows.length; i++) {
    447                     rows[i].style.display = 'table-row';
    448                 }
    449 
    450                 document.getElementById('moreFilterOptionsLabel').innerHTML = "Hide Filter Options";
    451                 document.getElementById('moreFilterOptionsLabel').setAttribute("onclick", "javascript: lessFilterOptions(); return false;");
    452 
    453             }
    454 
    455             function lessFilterOptions() {
    456                 var rows = document.getElementsByClassName('filter-options');
    457 
    458                 for (var i = 0; i < rows.length; i++) {
    459                     rows[i].style.display = 'none';
    460                 }
    461 
    462                 document.getElementById('moreFilterOptionsLabel').innerHTML = "Show Filter Options";
    463                 document.getElementById('moreFilterOptionsLabel').setAttribute("onclick", "javascript: moreFilterOptions(); return false;");
    464 
    465             }
    466 
    467             function setMinValueForPostsUptoField() {
    468                 console.log(document.getElementById('posts-from').value);
    469                 if (document.getElementById('posts-from').value != "") {
    470                     document.getElementById('posts-upto').setAttribute('min', document.getElementById('posts-from').value);
    471                 }
    472 
    473             }
    474         </script>
    475 
    476 
    477293    </div>
    478294
     
    480296<?php
    481297    if (isset($_POST['export'])) {
     298
     299
     300
    482301
    483302        if (isset($_REQUEST['_wpnonce'])) {
    484303            $nonce = $_REQUEST['_wpnonce'];
    485304            if (!wp_verify_nonce($nonce, 'export_urls')) {
    486                 echo "<div class='notice notice-error' style='width: 93%'>Security token validation failed!</div>";
     305                echo "<div class='notice notice-error' style='width: 93%'></div>";
    487306                exit;
    488307            }
     
    504323
    505324                    if (!isset($offset) || !isset($post_per_page)) {
    506                         echo "<div class='notice notice-error' style='width: 93%'>Sorry, you didn't specify starting and ending post range. Please <strong>Set Post Range</strong> OR <strong>Select All</strong> and try again! :)</div>";
     325                        echo "<div class='notice notice-error' style='width: 93%'></div>";
    507326                        exit;
    508327                    }
     
    516335                if ($export_type == 'text') {
    517336                    if (empty($csv_name)) {
    518                         echo "<div class='notice notice-error' style='width: 93%'>Invalid/Missing CSV File Name!</div>";
     337                        echo "<div class='notice notice-error' style='width: 93%'></div>";
    519338                        exit;
    520339                    }
     
    527346
    528347                    if ($posts_from > $posts_upto) {
    529                         echo "<div class='notice notice-error' style='width: 93%'>Sorry, invalid post date range. :)</div>";
     348                        echo "<div class='notice notice-error' style='width: 93%'></div>";
    530349                        exit;
    531350                    }
     
    535354                }
    536355
    537                 eau_generate_output($post_type, $post_status, $post_author, $exclude_domain, $post_per_page, $offset, $export_type, $export_fields, $csv_name, $posts_from, $posts_upto);
     356                eau_generate_output($post_type, $post_status, $post_author, $exclude_domain, $post_per_page, $offset, $export_type, $export_fields, $csv_name, $posts_from, $posts_upto);
    538357            } else {
    539                 echo "<div class='notice notice-error' style='width: 93%'>Sorry, you missed something, Please recheck above options, especially <strong>Export Fields</strong> and try again! :)</div>";
     358                echo "<div class='notice notice-error' style='width: 93%'></div>";
    540359                exit;
    541360            }
    542361        } else {
    543             echo "<div class='notice notice-error' style='width: 93%'>Verification token is missing!</div>";
     362            echo "<div class='notice notice-error' style='width: 93%'></div>";
    544363            exit;
    545364        }
    546365    } elseif (isset($_REQUEST['del']) && $_REQUEST['del'] == 'y') {
    547366        if (!isset($_REQUEST['_wpnonce']) || !wp_verify_nonce($_GET['_wpnonce'])) {
    548             echo "You are not authorized to perform this action!";
     367            echo ;
    549368            exit();
    550369        } else {
     
    554373
    555374            if (($path_info['dirname'] == $upload_dir['path']) && ($path_info['extension'] == 'CSV')) {
    556                 echo !empty($file) ? (file_exists($file) ? (!unlink($file) ? "<div class='notice notice-error' style='width: 97%'></div>Unable to delete file, please delete it manually!" : "<div class='updated' style='width: 97%'>You did great, the file was <strong>Deleted Successfully</strong>!</div>") : null) : "<div class='notice notice-error'>Missing file path.</div>";
     375                echo !empty($file) ? (file_exists($file) ? (!unlink($file) ? "<div class='notice notice-error' style='width: 97%'></div></div>";
    557376            } else {
    558                 die("<div class='error' style='width: 95.3%; margin-left: 2px;'>Sorry, the file verification failed. Arbitrary file removal is not allowed.</div>");
     377                die("<div class='error' style='width: 95.3%; margin-left: 2px;'></div>");
    559378            }
    560379        }
  • export-all-urls/trunk/extract-all-urls.php

    r2926489 r2990491  
    55Plugin URI: https://AtlasGondal.com/
    66Description: This plugin enables you to extract information such as Title, URL, Categories, Tags, Author, as well as Published and Modified dates for built-in post types (e.g., post, page) or any other custom post types present on your site. You have the option to display the output in the dashboard or export it as a CSV file. This can be highly beneficial for tasks like migration, SEO analysis, and security audits.
    7 Version: 4.6
     7Version: 4.
    88Author: Atlas Gondal
    99Author URI: https://AtlasGondal.com/
     
    1212*/
    1313
     14
    1415
    15 function eau_extract_all_urls_nav()
     16defined('ABSPATH') || exit;
     17
     18require_once(plugin_dir_path(__FILE__) . 'classes/constants.php');
     19
     20class ExportAllUrls
    1621{
    1722
    18     add_management_page('Export All URLs', 'Export All URLs', 'manage_options', 'extract-all-urls-settings', 'eau_include_settings_page');
     23    public function __construct()
     24    {
     25        add_action('admin_menu', array($this, 'extract_all_urls_nav'));
     26        register_activation_hook(__FILE__, array($this, 'on_activate'));
     27        add_action('admin_init', array($this, 'redirect_on_activation'));
     28        add_filter('admin_footer_text', array($this, 'footer_text'));
     29        add_action('admin_enqueue_scripts', array($this, 'enqueue_scripts'));
     30    }
     31
     32    public function extract_all_urls_nav()
     33    {
     34        add_management_page(Constants::PLUGIN_NAME, Constants::PLUGIN_NAME, Constants::PLUGIN_SETTINGS_PAGE_CAPABILITY, Constants::PLUGIN_SETTINGS_PAGE_SLUG, array($this, 'include_settings_page'));
     35    }
     36
     37    public function enqueue_scripts()
     38        {           
     39            wp_enqueue_style('eau-style', plugin_dir_url(__FILE__) . 'assets/css/style.css', array(), '1.0.0', 'all');
     40            wp_enqueue_script('eau-script', plugin_dir_url(__FILE__) . 'assets/js/script.js', array('jquery'), '1.0.0', true);
     41        }
     42
     43    public function include_settings_page()
     44    {
     45        include(plugin_dir_path(__FILE__) . 'extract-all-urls-settings.php');
     46    }
     47
     48    public function on_activate()
     49    {
     50        if (version_compare(PHP_VERSION, '5.4', '<')) {
     51            deactivate_plugins(plugin_basename(__FILE__));
     52            $plugin_data = get_plugin_data(__FILE__);
     53            $plugin_version = $plugin_data['Version'];
     54            $plugin_name = $plugin_data['Name'];
     55            wp_die('<h1>' . __('Could not activate plugin: PHP version error', Constants::PLUGIN_TEXT_DOMAIN) . '</h1><h2>' . __('PLUGIN:', Constants::PLUGIN_TEXT_DOMAIN) . ' <i>' . $plugin_name . ' ' . $plugin_version . '</i></h2><p><strong>' . __('You are using PHP version', Constants::PLUGIN_TEXT_DOMAIN) . ' ' . PHP_VERSION . '</strong>. ' . __('This plugin has been tested with PHP versions 5.4 and greater.', Constants::PLUGIN_TEXT_DOMAIN) . '</p><p>' . __('WordPress itself recommends using PHP version 7.4 or greater', Constants::PLUGIN_TEXT_DOMAIN) . ': <a href="https://wordpress.org/about/requirements/" target="_blank">' . __('Official WordPress requirements', Constants::PLUGIN_TEXT_DOMAIN) . '</a>' . '. ' . __('Please upgrade your PHP version or contact your Server administrator.', Constants::PLUGIN_TEXT_DOMAIN) . '</p>', __('Could not activate plugin: PHP version error', Constants::PLUGIN_TEXT_DOMAIN), array('back_link' => true));
     56        }
     57        set_transient('export_all_urls_activation_redirect', true, 30);
     58    }
     59
     60    function redirect_on_activation()
     61    {
     62
     63        if (!get_transient('export_all_urls_activation_redirect')) {
     64            return;
     65        }
     66
     67        delete_transient('export_all_urls_activation_redirect');
     68
     69        wp_safe_redirect(add_query_arg(array('page' => 'extract-all-urls-settings'), admin_url('tools.php')));
     70    }
     71
     72    function footer_text($footer_text)
     73    {
     74        $current_screen = get_current_screen();
     75        $is_export_all_urls_screen = ($current_screen && false !== strpos($current_screen->id, 'extract-all-urls-settings'));
     76
     77        if ($is_export_all_urls_screen) {
     78            $footer_text = sprintf(__('Enjoyed %s? Please leave us a %s rating. We really appreciate your support!', Constants::PLUGIN_TEXT_DOMAIN), '<strong>Export All URLs</strong>', '<a href="https://wordpress.org/support/plugin/export-all-urls/reviews/?filter=5#new-post" target="_blank">&#9733;&#9733;&#9733;&#9733;&#9733;</a>');
     79        }
     80
     81        return $footer_text;
     82    }
    1983}
    2084
    21 add_action('admin_menu', 'eau_extract_all_urls_nav');
    22 
    23 function eau_include_settings_page()
    24 {
    25 
    26     include(plugin_dir_path(__FILE__) . 'extract-all-urls-settings.php');
    27 }
    28 
    29 function eau_export_all_urls_on_activate()
    30 {
    31     if (version_compare(PHP_VERSION, '5.4', '<')) {
    32         deactivate_plugins(plugin_basename(__FILE__));
    33         $plugin_data = get_plugin_data(__FILE__);
    34         $plugin_version = $plugin_data['Version'];
    35         $plugin_name = $plugin_data['Name'];
    36         wp_die('<h1>' . __('Could not activate plugin: PHP version error') . '</h1><h2>PLUGIN: <i>' . $plugin_name . ' ' . $plugin_version . '</i></h2><p><strong>' . __('You are using PHP version') . ' ' . PHP_VERSION . '</strong>. ' . __('This plugin has been tested with PHP versions 5.4 and greater.') . '</p><p>' . __('WordPress itself recommends using PHP version 7.3 or greater') . ': <a href="https://wordpress.org/about/requirements/" target="_blank">' . __('Official WordPress requirements') . '</a>' . '. ' . __('Please upgrade your PHP version or contact your Server administrator.') . '</p>', __('Could not activate plugin: PHP version error'), array('back_link' => true));
    37     }
    38     set_transient('eau_export_all_urls_activation_redirect', true, 30);
    39 }
    40 
    41 register_activation_hook(__FILE__, 'eau_export_all_urls_on_activate');
    42 
    43 function eau_redirect_on_export_all_urls_activation()
    44 {
    45 
    46     if (!get_transient('eau_export_all_urls_activation_redirect')) {
    47         return;
    48     }
    49 
    50     delete_transient('eau_export_all_urls_activation_redirect');
    51 
    52     wp_safe_redirect(add_query_arg(array('page' => 'extract-all-urls-settings'), admin_url('tools.php')));
    53 }
    54 add_action('admin_init', 'eau_redirect_on_export_all_urls_activation');
    55 
    56 add_filter('admin_footer_text', 'eau_admin_footer_text');
    57 function eau_admin_footer_text($footer_text)
    58 {
    59 
    60     $current_screen = get_current_screen();
    61 
    62     $is_export_all_urls_screen = ($current_screen && false !== strpos($current_screen->id, 'extract-all-urls-settings'));
    63 
    64     if ($is_export_all_urls_screen) {
    65         $footer_text = 'Enjoyed <strong>Export All URLs</strong>? Please leave us a <a href="https://wordpress.org/support/plugin/export-all-urls/reviews/?filter=5#new-post" target="_blank">&#9733;&#9733;&#9733;&#9733;&#9733;</a> rating. We really appreciate your support! ';
    66     }
    67 
    68     return $footer_text;
    69 }
     85new ExportAllUrls();
  • export-all-urls/trunk/readme.txt

    r2956487 r2990491  
    44Tags: extract urls, export urls, links, get links, get urls, custom post type urls, see links, extract title, export title, export post title, export title and url, export category, utilities, export, csv
    55Requires at least: 3.1
    6 Tested up to: 6.3
    7 Stable tag: 4.6
     6Tested up to: 6.
     7Stable tag: 4.
    88Requires PHP: 5.4
    99License: GPLv2 or later
     
    134134
    135135== Changelog ==
     136
     137
     138
     139
     140
    136141
    137142= 4.6 =
Note: See TracChangeset for help on using the changeset viewer.