Plugin Directory

Changeset 2398010


Ignore:
Timestamp:
10/12/2020 02:16:41 PM (5 years ago)
Author:
codeinwp
Message:

Release v3.5.0

Location:
feedzy-rss-feeds
Files:
141 added
18 edited

Legend:

Unmodified
Added
Removed
  • feedzy-rss-feeds/trunk/CHANGELOG.md

    r2369394 r2398010  
    11
     2 ### v3.5.0 - 2020-10-12
     3 **Changes:**
     4 * [Feat] Improved interface for adding new imports and for the imports listing page
     5* [Feat] Improved checks for feeds validity
     6 
    27 ### v3.4.3 - 2020-08-26
    38 **Changes:**
  • feedzy-rss-feeds/trunk/css/feedzy-rss-feed-import.css

    r2345315 r2398010  
    6262}
    6363
    64 table.wp-list-table th.column-feedzy-status {
    65     width: 100px;
     64tr.feedzy-import-status-row > td {
     65    margin: 0;
     66    padding: 0
    6667}
    6768
    68 table.wp-list-table td.column-feedzy-last_run .feedzy-api-error {
    69     max-height: 120px;
    70     overflow: hidden;
     69tr.feedzy-import-status-row table {
     70    width: 32%;
     71    table-layout: fixed;
    7172}
    7273
    73 table.wp-list-table td.column-feedzy-last_run .feedzy-api-error.expand {
    74     height: auto;
    75     max-height: 1400px; /* arbitrary number */
    76     overflow: visible;
     74tr.feedzy-import-status-row table tr td {
     75    width: 25%;
     76    background-color: #f1f1f1;
     77    text-align: center;
    7778}
     79
     80tr.feedzy-import-status-row table tr:first-of-type td {
     81    padding: 3px;
     82    font-size: 22px;
     83}
     84
     85tr.feedzy-import-status-row table tr:last-of-type td {
     86    background-color: #5555559c;
     87    color: #ffffff;
     88    padding: 0px;
     89    text-transform: lowercase;
     90}
     91
     92.feedzy-error-status i {
     93    font-size: 28px;
     94}
     95
     96.feedzy-error-status.import-error i {
     97    color: #ca4a1f;
     98}
     99
     100.feedzy-error-status.import-success i {
     101    color: #149714;
     102}
     103
     104td.feedzy-error-status a {
     105    vertical-align: middle;
     106}
     107
     108a.feedzy-popup-details {
     109    pointer-events: none;
     110    color: inherit;
     111}
     112
     113td.feedzy-has-popup {
     114    cursor: pointer;
     115}
     116
     117.feedzy-has-popup a.feedzy-popup-details {
     118    cursor: pointer;
     119    pointer-events: all;
     120    color: #0073aa;
     121}
     122
     123.feedzy_run_now_msg {
     124    font-size: 14px !important;
     125    color: #ca4a1f !important;
     126    background-color: inherit !important;
     127}
     128
     129
     130@media screen and (max-width: 782px) {
     131    tr.feedzy-import-status-row table {
     132        width: 100%;
     133    }
     134
     135    tr.feedzy-import-status-row table tr:last-of-type td {
     136        font-size: smaller;
     137    }
     138}
  • feedzy-rss-feeds/trunk/css/feedzy-rss-feeds.css

    r2369394 r2398010  
    33 * Feedzy RSS Feed
    44 * Copyright: (c) 2016 Themeisle, themeisle.com
    5  * Version: 3.4.3
     5 * Version: 3.5.0
    66 * Plugin Name: FEEDZY RSS Feeds
    77 * Plugin URI: http://themeisle.com/plugins/feedzy-rss-feeds/
  • feedzy-rss-feeds/trunk/feedzy-rss-feed.php

    r2369394 r2398010  
    1616 * Plugin URI:        https://themeisle.com/plugins/feedzy-rss-feeds-lite/
    1717 * Description:       A small and lightweight RSS aggregator plugin. Fast and very easy to use, it allows you to aggregate multiple RSS feeds into your WordPress site through fully customizable shortcodes & widgets.
    18  * Version:           3.4.3
     18 * Version:           3.5.0
    1919 * Author:            Themeisle
    2020 * Author URI:        http://themeisle.com
  • feedzy-rss-feeds/trunk/includes/abstract/feedzy-rss-feeds-admin-abstract.php

    r2358719 r2398010  
    139139        global $post;
    140140        // Show the error message only if the user who has created this post (which contains the feed) is logged in.
     141        // Or if this is in the dry run window.
    141142        // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
    142         $show_error = is_user_logged_in() && $post && get_current_user_id() == $post->post_author;
     143        $show_error = is_admin() || ( is_user_logged_in() && $post && get_current_user_id() == $post->post_author );
    143144        $error_msg = '';
    144145
     
    151152        }
    152153
     154        $final_msg = '';
     155
    153156        if ( $show_error ) {
    154             return '<div id="message" class="error"><p>' . sprintf( __( 'Sorry, some part of this feed is currently unavailable or does not exist anymore. The detailed error is %1$s %2$s(Only you are seeing this detailed error because you are the creator of this post. Other users will see the error message as below.)%3$s', 'feedzy-rss-feeds' ), '<p style="font-weight: bold">' . $error_msg . '</p>', '<small>', '</small>' ) . '</p></div>';
     157            $final_msg = '<div id="message" class="error"><p>' . sprintf( __( 'Sorry, some part of this feed is currently unavailable or does not exist anymore. The detailed error is %s', 'feedzy-rss-feeds' ), '<p style="font-weight: bold">' . $error_msg . '</p>' );
     158            if ( ! is_admin() ) {
     159                $final_msg .= sprintf( __( '%1$s(Only you are seeing this detailed error because you are the creator of this post. Other users will see the error message as below.)%2$s', 'feedzy-rss-feeds' ), '<small>', '</small>' );
     160            }
     161            $final_msg .= '</p></div>';
    155162        } else {
    156163            error_log( 'Feedzy RSS Feeds - related feed: ' . print_r( $feed_url, true ) . ' - Error message: ' . $error_msg );
    157164        }
    158         return '';
     165        return $final_msg;
    159166    }
    160167
     
    378385            wp_localize_script( $this->plugin_name . '-lazy', 'feedzy', array( 'url' => get_rest_url( null, 'feedzy/v' . FEEDZY_REST_VERSION . '/lazy/' ), 'rest_nonce' => wp_create_nonce( 'wp_rest' ), 'nonce' => wp_create_nonce( 'feedzy' ) ) );
    379386            return $html;
     387        }
     388
     389        if ( isset( $sc['_dry_run_tags_'] ) ) {
     390            if ( strpos( $sc['_dry_run_tags_'], 'item_full_content' ) !== false ) {
     391                $sc_clone = $sc;
     392                $sc_clone['__jobID'] = ''; // pro expects this but keep it empty.
     393                $feedURL = apply_filters( 'feedzy_import_feed_url', $feed_url, '[#item_full_content]', $sc_clone );
     394                if ( ! is_wp_error( $feedURL ) ) {
     395                    $feed_url = $feedURL;
     396                }
     397            }
    380398        }
    381399
     
    501519                // lazy loading of feeds?
    502520                'lazy'          => 'no',
     521                // this are only for internal purposes
     522                '_dryrun_'      => 'no',
     523                '_dry_run_tags_'      => '',
    503524            ),
    504525            $atts,
     
    525546        if ( is_array( $feed_url ) ) {
    526547            foreach ( $feed_url as $index => $url ) {
    527                 $feed_url[ $index ] = $this->smart_convert( $url );
     548                $feed_url[ $index ] = trim( $this->smart_convert( $url ) );
    528549            }
    529550        } else {
    530             $feed_url = $this->smart_convert( $feed_url );
     551            $feed_url = trim( $this->smart_convert( $feed_url ) );
    531552        }
    532553
     
    757778     *
    758779     * @since   3.2.0
    759      * @access  private
     780     * @access  protected
    760781     *
    761782     * @param   array|string $feed_url The feeds URL/s.
    762783     * @param   string       $cache The cache string (eg. 1_hour, 30_min etc.).
     784     * @param   bool         $echo Echo the results.
    763785     *
    764786     * @return array
    765787     */
    766     private function get_valid_feed_urls( $feed_url, $cache ) {
     788    protected function get_valid_feed_urls( $feed_url, $cache, $echo = true ) {
    767789        $valid_feed_url = array();
    768790        if ( is_array( $feed_url ) ) {
     
    771793                    $valid_feed_url[] = $url;
    772794                } else {
    773                     echo sprintf( __( 'Feed URL: %s not valid and removed from fetch.', 'feedzy-rss-feeds' ), '<b>' . $url . '</b>' );
     795                    if ( $echo ) {
     796                        echo sprintf( __( 'Feed URL: %s not valid and removed from fetch.', 'feedzy-rss-feeds' ), '<b>' . $url . '</b>' );
     797                    }
    774798                }
    775799            }
     
    778802                $valid_feed_url[] = $feed_url;
    779803            } else {
    780                 echo sprintf( __( 'Feed URL: %s not valid and removed from fetch.', 'feedzy-rss-feeds' ), '<b>' . $feed_url . '</b>' );
     804                if ( $echo ) {
     805                    echo sprintf( __( 'Feed URL: %s not valid and removed from fetch.', 'feedzy-rss-feeds' ), '<b>' . $feed_url . '</b>' );
     806                }
    781807            }
    782808        }
     
    789815     *
    790816     * @since   3.2.0
    791      * @access  private
     817     * @access  protected
    792818     *
    793819     * @param   string $url The URL to validate.
     
    796822     * @return bool
    797823     */
    798     private function check_valid_xml( $url, $cache ) {
    799         $feed = $this->init_feed( $url, $cache );
     824    protected function check_valid_xml( $url, $cache ) {
     825        $feed = $this->init_feed( $url, $cache, array() );
    800826        if ( $feed->error() ) {
    801827            return false;
     
    898924        $anchor1 = '<a href="%s" target="%s" rel="%s noopener" title="%s" style="%s">%s</a>';
    899925        $anchor2 = '<a href="%s" target="%s" rel="%s noopener">%s</a>';
     926        $line_item = '<li %s>%s<span class="title">%s</span><div class="%s" style="%s">%s%s</div></li>';
     927        $dry_run_item = '<li %s><span class="title">%s</span><div class="dry_run">%s</div></li>';
     928        $is_dry_run = isset( $sc['_dryrun_'] ) && $sc['_dryrun_'] === 'yes';
    900929        foreach ( $feed_items as $item ) {
    901             $content .= '
    902             <li ' . $item['itemAttr'] . '>
    903                 ' . ( ( ! empty( $item['item_img'] ) && $sc['thumb'] !== 'no' ) ? '
    904                 <div class="' . $item['item_img_class'] . '" style="' . $item['item_img_style'] . '">'
    905                 . sprintf( $anchor1, $item['item_url'], $item['item_url_target'], $item['item_url_follow'], $item['item_url_title'], $item['item_img_style'], $item['item_img'] )
    906                 . '</div>' : '' )
    907                 . '<span class="title">'
    908                 . sprintf( $anchor2, $item['item_url'], $item['item_url_target'], $item['item_url_follow'], $item['item_title'] )
    909                 . '</span>
    910                 <div class="' . $item['item_content_class'] . '" style="' . $item['item_content_style'] . '">
    911                     ' . ( ! empty( $item['item_meta'] ) ? '<small>
    912                         ' . $item['item_meta'] . '
    913                     </small>' : '' ) . '
    914                     ' . ( ! empty( $item['item_description'] ) ? '<p>' . $item['item_description'] . '</p>' : '' ) . '
    915                 </div>
    916             </li>
    917             ';
     930            if ( $is_dry_run ) {
     931                $details = $this->get_dry_run_results( $sc, $item );
     932                $content .= sprintf(
     933                    $dry_run_item,
     934                    $item['itemAttr'],
     935                    sprintf( $anchor2, $item['item_url'], $item['item_url_target'], $item['item_url_follow'], $item['item_title'] ),
     936                    $details
     937                );
     938            } else {
     939                $content .= sprintf(
     940                    $line_item,
     941                    $item['itemAttr'],
     942                    ! empty( $item['item_img'] ) && $sc['thumb'] !== 'no' ? sprintf( '<div class="%s" style="%s">%s</div>', $item['item_img_class'], $item['item_img_style'], sprintf( $anchor1, $item['item_url'], $item['item_url_target'], $item['item_url_follow'], $item['item_url_title'], $item['item_img_style'], $item['item_img'] ) ) : '',
     943                    sprintf( $anchor2, $item['item_url'], $item['item_url_target'], $item['item_url_follow'], $item['item_title'] ),
     944                    $item['item_content_class'],
     945                    $item['item_content_style'],
     946                    empty( $item['item_meta'] ) ? '' : sprintf( '<small>%s</small>', $item['item_meta'] ),
     947                    empty( $item['item_description'] ) ? '' : sprintf( '<p>%s</p>', $item['item_description'] )
     948                );
     949            }
    918950        }
    919951        $content .= '</ul> </div>';
    920         $content = apply_filters( 'feedzy_global_output', $content, $sc, $feed_title, $feed_items );
     952        if ( ! $is_dry_run ) {
     953            $content = apply_filters( 'feedzy_global_output', $content, $sc, $feed_title, $feed_items );
     954        }
    921955        return $content;
     956    }
     957
     958    /**
     959     * Gets the results of the dry run.
     960     *
     961     * @since   ?
     962     * @access  private
     963     *
     964     * @param   array  $sc The shorcode attributes array.
     965     * @param   object $item The feed item array.
     966     *
     967     * @return  string
     968     */
     969    private function get_dry_run_results( $sc, $item ) {
     970        $statuses = array();
     971        $details = '';
     972        if ( true === apply_filters( 'feedzy_is_license_of_type', false, 'business' ) ) {
     973            if ( ! empty( $item['full_content_error'] ) ) {
     974                $statuses[] = array( 'success' => false, 'msg' => sprintf( __( 'Full content: %s', 'feedzy-rss-feeds' ), $item['full_content_error'] ) );
     975            } elseif ( isset( $item['item_full_content'] ) ) {
     976                if ( ! empty( $item['item_full_content'] ) ) {
     977                    $statuses[] = array( 'success' => true, 'msg' => __( 'Full content extracted', 'feedzy-rss-feeds' ) );
     978                } else {
     979                    $statuses[] = array( 'success' => true, 'msg' => __( 'Full content extracted (is empty)', 'feedzy-rss-feeds' ) );
     980                }
     981            }
     982        }
     983        if ( strpos( $sc['_dry_run_tags_'], 'item_image' ) !== false ) {
     984            if ( ! empty( $item['item_img_path'] ) ) {
     985                $statuses[] = array( 'success' => true, 'msg' => __( 'Image', 'feedzy-rss-feeds' ) );
     986            } else {
     987                $statuses[] = array( 'success' => false, 'msg' => __( 'Unable to find image', 'feedzy-rss-feeds' ) );
     988            }
     989        }
     990
     991        if ( $statuses ) {
     992            foreach ( $statuses as $status ) {
     993                $details .= sprintf(
     994                    '<span><i class="dashicons dashicons-%s %s"></i>%s',
     995                    $status['success'] ? 'yes' : 'no-alt',
     996                    $status['success'] ? 'pass' : 'fail',
     997                    $status['msg']
     998                );
     999            }
     1000        }
     1001        return $details;
    9221002    }
    9231003
     
    9631043            // Remove SSL from HTTP request to prevent fetching errors
    9641044            foreach ( $feeds as $feed ) {
     1045                $feed = trim( $feed );
     1046                // scheme-less URLs.
     1047                if ( strpos( $feed, 'http' ) !== 0 ) {
     1048                    $feed = 'http://' . $feed;
     1049                }
    9651050                if ( FEEDZY_ALLOW_HTTPS ) {
    9661051                    $feed_url[] = $feed;
    9671052                } else {
    9681053                    $feed_url[] = preg_replace( '/^https:/i', 'http:', $feed );
    969                 }
    970                 // scheme-less URLs.
    971                 if ( strpos( $feed, 'http' ) !== 0 ) {
    972                     $feed = 'http://' . $feed;
    9731054                }
    9741055            }
  • feedzy-rss-feeds/trunk/includes/admin/feedzy-rss-feeds-admin.php

    r2369394 r2398010  
    115115        if ( ! isset( $screen->base ) ) {
    116116            return;
     117        }
     118
     119        if ( $screen->post_type === 'feedzy_categories' ) {
     120            wp_enqueue_script(
     121                $this->plugin_name . '_categories',
     122                FEEDZY_ABSURL . 'js/categories.js',
     123                array(
     124                    'jquery',
     125                ),
     126                $this->version,
     127                true
     128            );
     129            wp_localize_script(
     130                $this->plugin_name . '_categories',
     131                'feedzy',
     132                array(
     133                    'ajax' => array(
     134                        'security'  => wp_create_nonce( FEEDZY_NAME ),
     135                    ),
     136                    'l10n' => array(
     137                        'validate' => __( 'Validate & Clean', 'feedzy-rss-feeds' ),
     138                        'validating' => __( 'Validating', 'feedzy-rss-feeds' ) . '...',
     139                        'validated' => __( 'Removed # URL(s)!', 'feedzy-rss-feeds' ),
     140                    ),
     141                )
     142            );
    117143        }
    118144
     
    246272        $nonce  = wp_create_nonce( FEEDZY_BASEFILE );
    247273        $feed   = get_post_meta( $post->ID, 'feedzy_category_feed', true );
     274        $invalid = $this->get_source_validity_error( '', $post );
     275
    248276        $output = '
    249277            <input type="hidden" name="feedzy_category_meta_noncename" id="feedzy_category_meta_noncename" value="' . $nonce . '" />
    250             <strong>' . sprintf( __( 'Please be aware that multiple feeds, when mashed together, may sometimes not work as expected as explained %1$shere%2$s.', 'feedzy-rss-feeds' ), '<a href="http://simplepie.org/wiki/faq/typical_multifeed_gotchas" target="_blank">', '</a>' ) . '</strong><br/><br/>
    251             <textarea name="feedzy_category_feed" rows="15" class="widefat" placeholder="' . __( 'Place your URL\'s here followed by a comma.', 'feedzy-rss-feeds' ) . '" >' . $feed . '</textarea>
     278            <strong>' . sprintf( __( 'Please be aware that multiple feeds, when mashed together, may sometimes not work as expected as explained %1$shere%2$s.', 'feedzy-rss-feeds' ), '<a href="http://simplepie.org/wiki/faq/typical_multifeed_gotchas" target="_blank">', '</a>' ) . '</strong><br/><br/>'
     279            . $invalid
     280            . '<textarea name="feedzy_category_feed" rows="15" class="widefat" placeholder="' . __( 'Place your URL\'s here followed by a comma.', 'feedzy-rss-feeds' ) . '" >' . $feed . '</textarea>
    252281        ';
    253282        echo $output;
     
    317346        }
    318347
     348        if ( $new_columns = $this->array_insert_before( 'date', $columns, 'actions', __( 'Actions', 'feedzy-rss-feeds' ) ) ) {
     349            $columns = $new_columns;
     350        } else {
     351            $columns['actions'] = __( 'Actions', 'feedzy-rss-feeds' );
     352        }
     353
    319354        return $columns;
     355    }
     356
     357    /**
     358     * Add/remove row actions for each category.
     359     *
     360     * @since   ?
     361     * @access  public
     362     */
     363    public function add_feedzy_category_actions( $actions, $post ) {
     364        if ( $post->post_type === 'feedzy_categories' ) {
     365            // don't need quick edit.
     366            unset( $actions['inline hide-if-no-js'] );
     367        }
     368        return $actions;
    320369    }
    321370
     
    342391                    echo '<code>' . $slug . '</code>';
    343392                }
     393                break;
     394            case 'actions':
     395                echo sprintf( '<button class="button button-primary validate-category" title="%s" data-category-id="%d">%s</button>', __( 'Click to remove invalid URLs from this category', 'feedzy-rss-feeds' ), $post_id, __( 'Validate & Clean', 'feedzy-rss-feeds' ) );
    344396                break;
    345397            default:
     
    590642    }
    591643
    592 
     644    /**
     645     * Validates the URLs and removes the ones that were found to be invalid.
     646     *
     647     * @access  public
     648     */
     649    public function validate_category_feeds( $check, $object_id, $meta_key, $meta_value, $prev_value ) {
     650        if ( 'feedzy_category_feed' === $meta_key && 'feedzy_categories' === get_post_type( $object_id ) ) {
     651            remove_filter( current_filter(), array( $this, 'validate_category_feeds' ) );
     652            $valid = $this->check_source_validity( $meta_value, $object_id, true, true );
     653            update_post_meta( $object_id, $meta_key, empty( $valid ) ? '' : implode( ', ', $valid ) );
     654            return true;
     655        }
     656
     657        return $check;
     658    }
     659
     660    /**
     661     * Validates the source (category or URL(s)) and returns only the ones that were found to be valid.
     662     *
     663     * @access  public
     664     */
     665    public function check_source_validity( $src, $post_id, $add_pseudo_transient, $return_valid ) {
     666        $urls_in = $src;
     667        $post_type = get_post_type( $post_id );
     668        if ( 'feedzy_imports' === $post_type && strpos( $src, 'http' ) === false && strpos( $src, 'https' ) === false ) {
     669            // category
     670            $category = get_page_by_path( $src, OBJECT, 'feedzy_categories' );
     671            if ( $category ) {
     672                $urls_in = get_post_meta( $category->ID, 'feedzy_category_feed', true );
     673            }
     674        }
     675
     676        // this method is fired through ajax when the category title is updated
     677        // even without clicking the publish button
     678        // thereby sending empty urls
     679        if ( empty( $urls_in ) ) {
     680            return array();
     681        }
     682
     683        $urls = $this->normalize_urls( $urls_in );
     684        if ( ! is_array( $urls ) ) {
     685            $urls = array( $urls );
     686        }
     687        $valid = $this->get_valid_feed_urls( $urls, '1_mins', false );
     688        $invalid = array_diff( $urls, $valid );
     689
     690        if ( $add_pseudo_transient && ( empty( $valid ) || ! empty( $invalid ) ) ) {
     691            // let's save the invalid urls in a pseudo-transient so that we can show it in the import edit screen.
     692            switch ( $post_type ) {
     693                case 'feedzy_categories':
     694                    update_post_meta( $post_id, '__transient_feedzy_category_feed', $invalid );
     695                    break;
     696                case 'feedzy_imports':
     697                    update_post_meta( $post_id, '__transient_feedzy_invalid_source', $invalid );
     698                    break;
     699            }
     700        }
     701
     702        if ( is_null( $return_valid ) ) {
     703            return array(
     704                'valid' => $valid,
     705                'invalid' => $invalid,
     706            );
     707        }
     708
     709        if ( $return_valid ) {
     710            return $valid;
     711        }
     712
     713        return $invalid;
     714    }
     715
     716    /**
     717     * Returns the error message to display if invalid URLs are found in the source (category or URL(s)).
     718     *
     719     * @access  public
     720     */
     721    public function get_source_validity_error( $message = '', $post, $class = '' ) {
     722        $invalid = $text = null;
     723        switch ( $post->post_type ) {
     724            case 'feedzy_categories':
     725                $text = __( 'We found the following invalid URLs that we have removed from the list', 'feedzy-rss-feeds' );
     726                $invalid = get_post_meta( $post->ID, '__transient_feedzy_category_feed', true );
     727                delete_post_meta( $post->ID, '__transient_feedzy_category_feed' );
     728                break;
     729            case 'feedzy_imports':
     730                $text = __( 'This source has invalid URLs. Please correct/remove the following', 'feedzy-rss-feeds' );
     731                $invalid = get_post_meta( $post->ID, '__transient_feedzy_invalid_source', true );
     732                delete_post_meta( $post->ID, '__transient_feedzy_invalid_source' );
     733                break;
     734            default:
     735                return $message;
     736        }
     737
     738        if ( $invalid ) {
     739            if ( empty( $class ) ) {
     740                $class = 'notice notice-error notice-alt feedzy-error-critical';
     741            }
     742            $message .= '<div class="' . $class . '"><p style="color: inherit"><i class="dashicons dashicons-warning"></i>' . $text . ': <ol style="color: inherit">';
     743            foreach ( $invalid as $url ) {
     744                $message .= '<li>' . ( empty( $url ) ? __( 'Empty URL', 'feedzy-rss-feeds' ) : esc_html( $url ) ) . '</li>';
     745            }
     746            $message .= '</ol></p></div>';
     747        }
     748        return $message;
     749    }
     750
     751    /**
     752     * AJAX single-entry method.
     753     *
     754     * @since   3.4.1
     755     * @access  public
     756     */
     757    public function ajax() {
     758        check_ajax_referer( FEEDZY_NAME, 'security' );
     759
     760        switch ( $_POST['_action'] ) {
     761            case 'validate_clean':
     762                // remove invalid URLs from this category.
     763                $urls = get_post_meta( $_POST['id'], 'feedzy_category_feed', true );
     764                $return = $this->check_source_validity( $urls, $_POST['id'], false, null );
     765                $valid = $return['valid'];
     766                $invalid = $return['invalid'];
     767                if ( ! empty( $valid ) ) {
     768                    remove_filter( 'update_post_metadata', array( $this, 'validate_category_feeds' ) );
     769                    update_post_meta( $_POST['id'], 'feedzy_category_feed', implode( ', ', $valid ) );
     770                }
     771                wp_send_json_success( array( 'invalid' => count( $invalid ) ) );
     772                break;
     773        }
     774    }
    593775}
  • feedzy-rss-feeds/trunk/includes/admin/feedzy-rss-feeds-import.php

    r2369394 r2398010  
    142142                    'ajax' => array(
    143143                        'security'  => wp_create_nonce( FEEDZY_BASEFILE ),
     144                    ),
     145                    'i10n' => array(
     146                        'importing' => __( 'Importing', 'feedzy-rss-feeds' ) . '...',
     147                        'run_now' => __( 'Run Now', 'feedzy-rss-feeds' ),
     148                        'dry_run_loading' => '<p class="hide-when-loaded">' . __( 'Processing the source and loading the items that will be imported when it runs', 'feedzy-rss-feeds' ) . '...</p>'
     149                                        . '<p><b>' . __( 'Please note that if some of these items have already have been imported in previous runs with the same filters, they may be shown here but will not be imported again.', 'feedzy-rss-feeds' ) . '</b></p>'
     150                                        . '<p class="loading-img hide-when-loaded"><img src="' . includes_url( 'images/wpspin-2x.gif' ) . '"></p><div></div>',
     151                        'dry_run_title' => __( 'Importable Items', 'feedzy-rss-feeds' ),
    144152                    ),
    145153                )
     
    288296        $import_featured_img  = get_post_meta( $post->ID, 'import_post_featured_img', true );
    289297
     298        // default values so that post is not created empty.
     299        if ( empty( $import_title ) ) {
     300            $import_title = '[#item_title]';
     301        }
     302        if ( empty( $import_content ) ) {
     303            $import_content = '[#item_content]';
     304        }
     305
    290306        $import_link_author_admin         = get_post_meta( $post->ID, 'import_link_author_admin', true );
    291307        $import_link_author_public        = get_post_meta( $post->ID, 'import_link_author_public', true );
     
    305321        $import_custom_fields = get_post_meta( $post->ID, 'imports_custom_fields', true );
    306322        $import_feed_limit    = get_post_meta( $post->ID, 'import_feed_limit', true );
     323        if ( empty( $import_feed_limit ) ) {
     324            $import_feed_limit = 10;
     325        }
    307326        $import_feed_delete_days    = intval( get_post_meta( $post->ID, 'import_feed_delete_days', true ) );
     327        if ( empty( $import_feed_delete_days ) ) {
     328            $import_feed_delete_days = 0;
     329        }
    308330        $post_status          = $post->post_status;
    309331        $nonce                = wp_create_nonce( FEEDZY_BASEFILE );
     332        $invalid_source_msg   = apply_filters( 'feedzy_get_source_validity_error', '', $post );
    310333        $output               = '
    311334            <input type="hidden" name="feedzy_category_meta_noncename" id="feedzy_category_meta_noncename" value="' . $nonce . '" />
    312335        ';
     336
     337        add_thickbox();
    313338        include FEEDZY_ABSPATH . '/includes/views/import-metabox-edit.php';
    314339        echo $output;
     
    362387            delete_post_meta( $post_id, 'import_link_author_public' );
    363388
     389            // we will activate this import only if the source has no invalid URL(s)
     390            $source_is_valid = false;
     391
    364392            foreach ( $data_meta as $key => $value ) {
    365393                $value = is_array( $value ) ? implode( ',', $value ) : implode( ',', (array) $value );
     394                if ( 'source' === $key ) {
     395                    // check if the source is valid
     396                    $invalid_urls = apply_filters( 'feedzy_check_source_validity', $value, $post_id, true, false );
     397                    $source_is_valid = empty( $invalid_urls );
     398                }
     399
    366400                if ( get_post_meta( $post_id, $key, false ) ) {
    367401                    update_post_meta( $post_id, $key, wp_kses( $value, wp_kses_allowed_html( 'post' ) ) );
     
    374408            }
    375409            // Added this to activate post if publish is clicked and sometimes it does not change status.
    376             if ( isset( $_POST['custom_post_status'] ) && $_POST['custom_post_status'] === 'Publish' ) {
     410            if ( $source_is_valid && isset( $_POST['custom_post_status'] ) && $_POST['custom_post_status'] === 'Publish' ) {
    377411                $activate = array(
    378412                    'ID'          => $post_id,
     
    402436        $post = get_post( $post_id );
    403437        if ( 'feedzy_imports' === $post->post_type ) {
    404             return admin_url( 'edit.php?post_type=feedzy_imports' );
     438            // if invalid source has been found, redirect back to edit screen
     439            // where errors can be shown
     440            $invalid = get_post_meta( $post_id, '__transient_feedzy_invalid_source', true );
     441            error_log( "redirect_post_location $post_id = " . print_r( $invalid, true ) );
     442            if ( empty( $invalid ) ) {
     443                return admin_url( 'edit.php?post_type=feedzy_imports' );
     444            }
    405445        }
    406446        return $location;
     
    431471        }
    432472
     473        if ( $new_columns = $this->array_insert_before( 'date', $columns, 'feedzy-next_run', __( 'Next Run', 'feedzy-rss-feeds' ) ) ) {
     474            $columns = $new_columns;
     475        } else {
     476            $columns['feedzy-next_run'] = __( 'Next Run', 'feedzy-rss-feeds' );
     477        }
     478
    433479        if ( $new_columns = $this->array_insert_before( 'date', $columns, 'feedzy-last_run', __( 'Last Run Status', 'feedzy-rss-feeds' ) ) ) {
    434480            $columns = $new_columns;
     
    437483        }
    438484
    439         if ( $new_columns = $this->array_insert_before( 'date', $columns, 'feedzy-next_run', __( 'Next Run', 'feedzy-rss-feeds' ) ) ) {
    440             $columns = $new_columns;
    441         } else {
    442             $columns['feedzy-next_run'] = __( 'Next Run', 'feedzy-rss-feeds' );
    443         }
     485        unset( $columns['date'] );
    444486
    445487        return $columns;
     
    514556                        <input id="feedzy-toggle_' . $post->ID . '" class="feedzy-toggle feedzy-toggle-round" type="checkbox" value="' . $post->ID . '" ' . $checked . '>
    515557                        <label for="feedzy-toggle_' . $post->ID . '"></label>
     558                        <span class="feedzy-spinner spinner"></span>
    516559                    </div>
    517560                    ';
     
    522565                $msg    = __( 'Never Run', 'feedzy-rss-feeds' );
    523566                if ( $last ) {
    524                     $msg = $this->get_import_status( $post_id );
    525                     $msg .= $this->get_import_info( $post_id );
    526                     $msg .= $this->get_import_errors( $post_id, false );
    527 
    528                     // show the total items imported across all runs.
    529                     $items      = get_post_meta( $post_id, 'imported_items_hash', true );
    530                     if ( empty( $items ) ) {
    531                         $items      = get_post_meta( $post_id, 'imported_items', true );
    532                     }
    533                     $count = $items ? count( $items ) : 0;
    534                     $url    = add_query_arg( array( 'feedzy_job_id' => $post_id, 'post_type' => get_post_meta( $post_id, 'import_post_type', true ) ), admin_url( 'edit.php' ) );
    535                     if ( ! defined( 'TI_CYPRESS_TESTING' ) && $count > 0 ) {
    536                         $msg    .= '<hr>' . sprintf( '%s: <b><a href="%s" target="_blank" title="%s">%d</a></b>', __( 'Items imported across runs', 'feedzy-rss-feeds' ), $url, __( 'Click to view', 'feedzy-rss-feeds' ), $count );
    537                     } else {
    538                         $msg    .= '<hr>' . sprintf( '%s: <b>%d</b>', __( 'Items imported across runs', 'feedzy-rss-feeds' ), $count );
    539                     }
    540                 }
     567                    $now  = new DateTime();
     568                    $then = new DateTime();
     569                    $then = $then->setTimestamp( $last );
     570                    $in   = $now->diff( $then );
     571                    $msg  = sprintf( __( 'Ran %1$d hours %2$d minutes ago', 'feedzy-rss-feeds' ), $in->format( '%h' ), $in->format( '%i' ) );
     572                }
     573
     574                $msg .= $this->get_last_run_details( $post_id );
    541575                echo $msg;
     576
     577                if ( 'publish' === $post->post_status ) {
     578                     echo sprintf( '<p><input type="button" class="button button-primary feedzy-run-now" data-id="%d" value="%s"></p>', $post_id, __( 'Run Now', 'feedzy-rss-feeds' ) );
     579                }
     580
    542581                break;
    543582            case 'feedzy-next_run':
     
    549588                    $in   = $now->diff( $then );
    550589                    echo sprintf( __( 'In %1$d hours %2$d minutes', 'feedzy-rss-feeds' ), $in->format( '%h' ), $in->format( '%i' ) );
    551                     if ( 'publish' === $post->post_status ) {
    552                          echo sprintf( '<br/><input type="button" class="button button-primary feedzy-run-now" data-id="%d" value="%s"><span class="feedzy-spinner spinner"></span>', $post_id, __( 'Run Now', 'feedzy-rss-feeds' ) );
    553                     }
    554590                }
    555591                break;
     
    560596
    561597    /**
    562      * Creates the basic message to show against each import.
     598     * Generate the markup that displays the status.
    563599     *
    564600     * @since   ?
    565601     * @access  private
    566      */
    567     private function get_import_status( $post_id ) {
     602     *
     603     * @param   integer $post_id The post ID.
     604     */
     605    private function get_last_run_details( $post_id ) {
     606        $msg    = '';
    568607        $last   = get_post_meta( $post_id, 'last_run', true );
     608        $status = array(
     609            'total' => '-',
     610            'items' => '-',
     611            'duplicates' => '-',
     612            'cumulative' => '-',
     613        );
     614        if ( $last ) {
     615            $status = array(
     616                'total' => 0,
     617                'items' => 0,
     618                'duplicates' => 0,
     619                'cumulative' => 0,
     620            );
     621            $status = $this->get_complete_import_status( $post_id );
     622        }
     623
     624        // link to the posts listing for this job.
     625        $job_linked_posts   = add_query_arg( array( 'feedzy_job_id' => $post_id, 'post_type' => get_post_meta( $post_id, 'import_post_type', true ) ), admin_url( 'edit.php' ) );
     626
     627        // link to the posts listing for this job run.
     628        $job_run_linked_posts    = '';
     629        $job_run_id   = get_post_meta( $post_id, 'last_run_id', true );
     630        if ( ! empty( $job_run_id ) ) {
     631            $job_run_linked_posts    = add_query_arg( array( 'feedzy_job_id' => $post_id, 'feedzy_job_time' => $job_run_id, 'post_type' => get_post_meta( $post_id, 'import_post_type', true ) ), admin_url( 'edit.php' ) );
     632        }
     633
     634        // popup for items found.
     635        if ( is_array( $status['items'] ) ) {
     636            $msg .= '<div class="feedzy-items-found-' . $post_id . ' feedzy-dialog" title="' . __( 'Items found', 'feedzy-rss-feeds' ) . '"><ol>';
     637            foreach ( $status['items'] as $url => $title ) {
     638                $msg .= sprintf( '<li><p><a href="%s" target="_blank">%s</a></p></li>', esc_url( $url ), esc_html( $title ) );
     639            }
     640            $msg .= '</ol></div>';
     641        }
     642
     643        // popup for duplicates found.
     644        if ( is_array( $status['duplicates'] ) ) {
     645            $msg .= '<div class="feedzy-duplicates-found-' . $post_id . ' feedzy-dialog" title="' . __( 'Duplicates found', 'feedzy-rss-feeds' ) . '"><ol>';
     646            foreach ( $status['duplicates'] as $url => $title ) {
     647                $msg .= sprintf( '<li><p><a href="%s" target="_blank">%s</a></p></li>', esc_url( $url ), esc_html( $title ) );
     648            }
     649            $msg .= '</ol></div>';
     650        }
     651
     652        $errors = $this->get_import_errors( $post_id );
     653        // popup for errors found.
     654        if ( ! empty( $errors ) ) {
     655            $msg .= '<div class="feedzy-errors-found-' . $post_id . ' feedzy-dialog" title="' . __( 'Errors', 'feedzy-rss-feeds' ) . '">' . $errors . '</div>';
     656        }
     657
     658        // remember, cypress will work off the data-value attributes.
     659        $msg .= sprintf(
     660            '<script class="feedzy-last-run-data" type="text/template">
     661                <tr style="display: none"></tr>
     662                <tr class="feedzy-import-status-row">
     663                    <td colspan="6" align="right">
     664                        <table>
     665                            <tr>
     666                                <td class="feedzy-items %s" data-value="%d"><a class="feedzy-popup-details feedzy-dialog-open" title="%s" data-dialog="feedzy-items-found-%d">%s</a></td>
     667                                <td class="feedzy-duplicates %s" data-value="%d"><a class="feedzy-popup-details feedzy-dialog-open" title="%s" data-dialog="feedzy-duplicates-found-%d">%s</a></td>
     668                                <td class="feedzy-imported %s" data-value="%d"><a target="%s" href="%s" class="feedzy-popup-details" title="%s">%s</a></td>
     669                                <td class="feedzy-cumulative %s" data-value="%d"><a target="%s" href="%s" class="feedzy-popup-details" title="%s">%s</a></td>
     670                                <td class="feedzy-error-status %s" data-value="%d"><a class="feedzy-popup-details feedzy-dialog-open" data-dialog="feedzy-errors-found-%d" title="%s">%s</a></td>
     671                            </tr>
     672                            <tr>
     673                                <td>%s</td>
     674                                <td>%s</td>
     675                                <td>%s</td>
     676                                <td>%s</td>
     677                                <td>%s</td>
     678                            </tr>
     679                        </table>
     680                    </td>
     681                </tr>
     682            </script>',
     683            // first cell
     684            is_array( $status['items'] ) ? 'feedzy-has-popup' : '',
     685            is_array( $status['items'] ) ? count( $status['items'] ) : $status['items'],
     686            __( 'Items that were found in the feed', 'feedzy-rss-feeds' ),
     687            $post_id,
     688            is_array( $status['items'] ) ? count( $status['items'] ) : $status['items'],
     689            // second cells
     690            is_array( $status['duplicates'] ) ? 'feedzy-has-popup' : '',
     691            is_array( $status['duplicates'] ) ? count( $status['duplicates'] ) : $status['duplicates'],
     692            __( 'Items that were discarded as duplicates', 'feedzy-rss-feeds' ),
     693            $post_id,
     694            is_array( $status['duplicates'] ) ? count( $status['duplicates'] ) : $status['duplicates'],
     695            // third cell
     696            $status['total'] > 0 && ! empty( $job_run_linked_posts ) ? 'feedzy-has-popup' : '',
     697            $status['total'],
     698            defined( 'TI_CYPRESS_TESTING' ) ? '' : '_blank',
     699            $status['total'] > 0 && ! empty( $job_run_linked_posts ) ? $job_run_linked_posts : '',
     700            __( 'Items that were imported', 'feedzy-rss-feeds' ),
     701            $status['total'],
     702            // fourth cell
     703            $status['cumulative'] > 0 ? 'feedzy-has-popup' : '',
     704            $status['cumulative'],
     705            defined( 'TI_CYPRESS_TESTING' ) ? '' : '_blank',
     706            $status['cumulative'] > 0 ? $job_linked_posts : '',
     707            __( 'Items that were imported across all runs', 'feedzy-rss-feeds' ),
     708            $status['cumulative'],
     709            // fifth cell
     710            empty( $last ) ? '' : ( ! empty( $errors ) ? 'feedzy-has-popup import-error' : 'import-success' ),
     711            empty( $last ) ? '-1' : ( ! empty( $errors ) ? 0 : 1 ),
     712            $post_id,
     713            __( 'View the errors', 'feedzy-rss-feeds' ),
     714            empty( $last ) ? '-' : ( ! empty( $errors ) ? '<i class="dashicons dashicons-warning"></i>' : '<i class="dashicons dashicons-yes-alt"></i>' ),
     715            // second row
     716            __( 'Found', 'feedzy-rss-feeds' ),
     717            __( 'Duplicates', 'feedzy-rss-feeds' ),
     718            __( 'Imported', 'feedzy-rss-feeds' ),
     719            __( 'Cumulative', 'feedzy-rss-feeds' ),
     720            __( 'Status', 'feedzy-rss-feeds' )
     721        );
     722
     723        return $msg;
     724    }
     725
     726    /**
     727     * Gets every aspect of the import job that would reflect its status.
     728     *
     729     * @since   ?
     730     * @access  private
     731     */
     732    private function get_complete_import_status( $post_id ) {
    569733        $items_count  = get_post_meta( $post_id, 'imported_items_count', true );
    570734        $items      = get_post_meta( $post_id, 'imported_items_hash', true );
     
    577741            $count  = count( $items );
    578742        }
    579         $now  = new DateTime();
    580         $then = new DateTime();
    581         $then = $then->setTimestamp( $last );
    582         $in   = $now->diff( $then );
    583         $msg  = sprintf( __( 'Imported %1$d item(s)<br>%2$d hours %3$d minutes ago', 'feedzy-rss-feeds' ), $count, $in->format( '%h' ), $in->format( '%i' ) );
    584 
    585         return apply_filters( 'feedzy_run_status_status', $msg, $post_id );
    586     }
    587 
    588     /**
    589      * Creates the data by extracting the 'import_errors' from each import.
    590      *
    591      * @since   ?
    592      * @access  private
    593      */
    594     private function get_import_errors( $post_id, $under_next_run ) {
    595         $msg = '';
    596         $import_errors = get_post_meta( $post_id, 'import_errors', true );
    597         if ( $import_errors ) {
    598             $title = ! $under_next_run ? __( 'Click to expand', 'feedzy-rss-feeds' ) : null;
    599             $msg = '<hr><div class="feedzy-error feedzy-api-error" title="' . esc_attr( $title ) . '"><i class="dashicons dashicons-warning"></i>' . implode( '<i class="dashicons dashicons-warning"></i>', $import_errors ) . '</div>';
    600         }
    601 
    602         $pro_msg = apply_filters( 'feedzy_run_status_errors', '', $post_id );
    603 
    604         // the pro messages may not have the dashicons, so let's add them.
    605         if ( $pro_msg && strpos( $pro_msg, 'dashicons-warning' ) === false ) {
    606             // we will have to add class="nothing" so that the <br> doesn't get overriden repeatedly.
    607             $pro_msg = '<hr>' . str_replace( '<br>', '<br class="nothing"><i class="dashicons dashicons-warning"></i>', $pro_msg );
    608             $pro_msg = str_replace( '<div class="feedzy-error feedzy-api-error"><br class="nothing">', '<div class="feedzy-error feedzy-api-error">', $pro_msg );
    609         }
    610 
    611         return $msg . $pro_msg;
    612     }
    613 
    614     /**
    615      * Creates the data by extracting the 'import_info' from each import.
    616      *
    617      * @since   ?
    618      * @access  private
    619      */
    620     private function get_import_info( $post_id ) {
    621         $msg = '';
     743
     744        $status = array(
     745            'total' => $count,
     746            'items' => 0,
     747            'duplicates' => 0,
     748            'cumulative' => 0,
     749        );
     750
    622751        $import_info = get_post_meta( $post_id, 'import_info', true );
    623752        if ( $import_info ) {
    624             $msg = '';
    625753            foreach ( $import_info as $label => $value ) {
    626754                switch ( $label ) {
    627755                    case 'total':
    628756                        if ( count( $value ) > 0 ) {
    629                             $msg .= '<br>' . sprintf( '%s: %s%d%s', __( 'Total items found', 'feedzy-rss-feeds' ), '<a href="#" title="' . __( 'Click to view details', 'feedzy-rss-feeds' ) . '" class="feedzy-dialog-open" data-dialog="feedzy-items-found-' . $post_id . '">', count( $value ), '</a>' );
    630                         } else {
    631                             $msg .= '<br>' . sprintf( '%s: %d', __( 'Total items found', 'feedzy-rss-feeds' ), count( $value ) );
    632                         }
    633                         if ( $value ) {
    634                             $msg .= '<div class="feedzy-items-found-' . $post_id . ' feedzy-dialog" title="' . __( 'Total items found', 'feedzy-rss-feeds' ) . '"><ol>';
    635                             foreach ( $value as $url => $title ) {
    636                                 $msg .= sprintf( '<li><p><a href="%s" target="_blank">%s</a></p></li>', esc_url( $url ), esc_html( $title ) );
    637                             }
    638                             $msg .= '</ol></div>';
     757                            $status['items'] = $value;
    639758                        }
    640759                        break;
    641760                    case 'duplicates':
    642761                        if ( count( $value ) > 0 ) {
    643                             $msg .= '<br>' . sprintf( '%s: %s%d%s', __( 'Duplicates found', 'feedzy-rss-feeds' ), '<a href="#" title="' . __( 'Click to view details', 'feedzy-rss-feeds' ) . '" class="feedzy-dialog-open" data-dialog="feedzy-dups-found-' . $post_id . '">', count( $value ), '</a>' );
    644                         }
    645                         if ( $value ) {
    646                             $msg .= '<div class="feedzy-dups-found-' . $post_id . ' feedzy-dialog" title="' . __( 'Duplicates found', 'feedzy-rss-feeds' ) . '"><ol>';
    647                             foreach ( $value as $url => $title ) {
    648                                 $msg .= sprintf( '<li><p><a href="%s" target="_blank">%s</a></p></li>', esc_url( $url ), esc_html( $title ) );
    649                             }
    650                             $msg .= '</ol></div>';
     762                            $status['duplicates'] = $value;
    651763                        }
    652764                        break;
     
    654766            }
    655767        }
    656         return apply_filters( 'feedzy_run_status_info', $msg, $post_id );
     768
     769        $items      = get_post_meta( $post_id, 'imported_items_hash', true );
     770        if ( empty( $items ) ) {
     771            $items      = get_post_meta( $post_id, 'imported_items', true );
     772        }
     773        if ( $items ) {
     774            $status['cumulative'] = count( $items );
     775        }
     776
     777        return $status;
     778
     779    }
     780
     781    /**
     782     * Creates the data by extracting the 'import_errors' from each import.
     783     *
     784     * @since   ?
     785     * @access  private
     786     */
     787    private function get_import_errors( $post_id ) {
     788        $msg = '';
     789        $import_errors = get_post_meta( $post_id, 'import_errors', true );
     790        if ( $import_errors ) {
     791            $errors = '';
     792            if ( is_array( $import_errors ) ) {
     793                foreach ( $import_errors as $err ) {
     794                    $errors .= '<div><i class="dashicons dashicons-warning"></i>' . $err . '</div>';
     795                }
     796            } else {
     797                $errors = '<div><i class="dashicons dashicons-warning"></i>' . $import_errors . '</div>';
     798            }
     799            $msg = '<div class="feedzy-error feedzy-api-error">' . $errors . '</div>';
     800        }
     801
     802        $pro_msg = apply_filters( 'feedzy_run_status_errors', '', $post_id );
     803
     804        // the pro messages may not have the dashicons, so let's add them.
     805        if ( $pro_msg && strpos( $pro_msg, 'dashicons-warning' ) === false ) {
     806            $errors = '';
     807            $pro_errors = explode( '<br>', $pro_msg );
     808            if ( is_array( $pro_errors ) ) {
     809                foreach ( $pro_errors as $err ) {
     810                    $errors .= '<div><i class="dashicons dashicons-warning"></i>' . $err . '</div>';
     811                }
     812            } else {
     813                $errors = '<div><i class="dashicons dashicons-warning"></i>' . $pro_errors . '</div>';
     814            }
     815            $pro_msg = '<div class="feedzy-error feedzy-api-error">' . $errors . '</div>';
     816
     817        }
     818
     819        return $msg . $pro_msg;
    657820    }
    658821
     
    665828    public function ajax() {
    666829        check_ajax_referer( FEEDZY_BASEFILE, 'security' );
     830
     831        $_POST['feedzy_category_meta_noncename'] = $_POST['security'];
    667832
    668833        switch ( $_POST['_action'] ) {
     
    679844                $this->purge_data();
    680845                break;
     846            case 'dry_run':
     847                $this->dry_run();
     848                break;
    681849        }
    682850    }
     
    692860        $id      = $_POST['id'];
    693861        $status  = $_POST['status'];
    694         $_POST['feedzy_category_meta_noncename'] = $_POST['security'];
    695862        $publish = 'draft';
     863
     864        // no activation till source is not valid.
    696865        if ( $status === 'true' ) {
     866            $invalid_urls = apply_filters( 'feedzy_check_source_validity', get_post_meta( $id, 'source', true ), $id, true, false );
     867            if ( ! empty( $invalid_urls ) ) {
     868                $msg = apply_filters( 'feedzy_get_source_validity_error', '', get_post( $id ), '' );
     869                wp_send_json_error( array( 'msg' => $msg ) );
     870            }
     871
    697872            $publish = 'publish';
    698873        }
     874
    699875        $new_post_status = array(
    700876            'ID'          => $id,
     
    708884        if ( is_wp_error( $post_id ) ) {
    709885            $errors = $post_id->get_error_messages();
    710             foreach ( $errors as $error ) {
    711                 echo $error;
    712             }
    713         }
    714         wp_die(); // this is required to terminate immediately and return a proper response
     886            wp_send_json_error( array( 'msg' => implode( ', ', $errors ) ) );
     887        }
     888        wp_send_json_success();
    715889    }
    716890
     
    754928        $count  = $this->run_job( $job, 100 );
    755929
    756         $msg    = $count > 0 ? sprintf( __( 'Successfully run! %d items imported.', 'feedzy-rss-feeds' ), $count ) : __( 'Nothing imported!', 'feedzy-rss-feeds' );
    757 
    758         $msg    .= $this->get_import_errors( $job->ID, true );
     930        $msg    = $count > 0 ? __( 'Successfully run!', 'feedzy-rss-feeds' ) : __( 'Nothing imported!', 'feedzy-rss-feeds' );
     931        $msg    .= ' (' . __( 'Refresh this page for the updated status', 'feedzy-rss-feeds' ) . ')';
    759932
    760933        wp_send_json_success( array( 'msg' => $msg ) );
    761934    }
     935
     936    /**
     937     * Dry run a specific job so that the user is aware what would be imported.
     938     *
     939     * @since  ?
     940     * @access  private
     941     */
     942    private function dry_run() {
     943        $fields = urldecode( $_POST['fields'] );
     944        parse_str( $fields, $data );
     945
     946        $feedzy_meta_data = $data['feedzy_meta_data'];
     947
     948        add_filter(
     949            'feedzy_default_error', function( $errors, $feed, $url ) {
     950                $errors .=
     951                sprintf( __( 'For %1$ssingle feeds%2$s, this could be because of the following reasons:', 'feedzy-rss-feeds' ), '<b>', '</b>' )
     952                . '<ol>'
     953                . '<li>' . sprintf( __( '%1$sSource invalid%2$s: Check that your source is valid by clicking the validate button adjacent to the source box.', 'feedzy-rss-feeds' ), '<b>', '</b>' ) . '</li>'
     954                . '<li>' . sprintf( __( '%1$sSource unavailable%2$s: Copy the source and paste it on the browser to check that it is available. It could be an intermittent issue.', 'feedzy-rss-feeds' ), '<b>', '</b>' ) . '</li>'
     955                . '<li>' . sprintf( __( '%1$sSource inaccessible from server%2$s: Check that your source is accessible from the server (not the browser). It could be an intermittent issue.', 'feedzy-rss-feeds' ), '<b>', '</b>' ) . '</li>'
     956                . '</ol>'
     957                . sprintf( __( 'For %1$smultiple feeds%2$s (comma-separated or in a Feedzy Category), this could be because of the following reasons:', 'feedzy-rss-feeds' ), '<b>', '</b>' )
     958                . '<ol>'
     959                . '<li>' . sprintf( __( '%1$sSource invalid%2$s: One or more feeds may be misbehaving. Check each feed individually as mentioned above to weed out the problematic feed.', 'feedzy-rss-feeds' ), '<b>', '</b>' ) . '</li>'
     960                . '</ol>';
     961
     962                return $errors;
     963            }, 11, 3
     964        );
     965
     966        // we will add tags corresponding to the most potential problems.
     967        $tags = array();
     968        if ( $this->feedzy_is_business() && strpos( $feedzy_meta_data['import_post_content'], 'full_content' ) !== false ) {
     969            $tags[] = 'item_full_content';
     970        }
     971        if ( strpos( $feedzy_meta_data['import_post_content'], 'item_image' ) !== false || strpos( $feedzy_meta_data['import_post_featured_img'], 'item_image' ) !== false ) {
     972            $tags[] = 'item_image';
     973        }
     974
     975        $shortcode = sprintf(
     976            '[feedzy-rss feeds="%s" max="%d" feed_title=no meta=no summary=no thumb=no error_empty="%s" keywords_title="%s" %s="%s" _dry_run_tags_="%s" _dryrun_="yes"]',
     977            $feedzy_meta_data['source'],
     978            $feedzy_meta_data['import_feed_limit'],
     979            '', // should be empty
     980            $feedzy_meta_data['inc_key'],
     981            feedzy_is_pro() ? 'keywords_ban' : '',
     982            feedzy_is_pro() ? $feedzy_meta_data['exc_key'] : '',
     983            implode( ',', $tags )
     984        );
     985
     986        wp_send_json_success( array( 'output' => do_shortcode( $shortcode ) ) );
     987    }
     988
    762989
    763990    /**
     
    8581085        $options['__jobID'] = $job->ID;
    8591086
    860         update_post_meta( $job->ID, 'last_run', time() );
     1087        $last_run = time();
     1088        update_post_meta( $job->ID, 'last_run', $last_run );
     1089        // we will use this last_run_id to associate imports with a specific job run.
     1090        update_post_meta( $job->ID, 'last_run_id', $last_run );
    8611091        delete_post_meta( $job->ID, 'import_errors' );
    8621092        delete_post_meta( $job->ID, 'import_info' );
     
    11151345            update_post_meta( $new_post_id, 'feedzy_item_author', sanitize_text_field( $author ) );
    11161346
     1347            // we can use this to associate the items that were imported in a particular run.
     1348            update_post_meta( $new_post_id, 'feedzy_job_time', $last_run );
     1349
    11171350            do_action( 'feedzy_after_post_import', $new_post_id, $item, $this->settings );
    11181351        }
     
    15871820    public function add_import_actions( $actions, $post ) {
    15881821        if ( $post->post_type === 'feedzy_imports' ) {
    1589 
    15901822            // don't need quick edit.
    15911823            unset( $actions['inline hide-if-no-js'] );
     
    15961828                esc_html( __( 'Purge &amp; Reset', 'feedzy-rss-feeds' ) )
    15971829            );
     1830        } elseif ( 1 === intval( get_post_meta( $post->ID, 'feedzy', true ) ) ) {
     1831            // show an unclickable action that mentions that it is imported by us
     1832            // so that users are aware
     1833            $actions['feedzy'] = sprintf( '(%s)', __( 'Imported by Feedzy', 'feedzy-rss-feeds' ) );
    15981834        }
    15991835        return $actions;
     
    16301866    public function pre_get_posts( $query ) {
    16311867        if ( is_admin() && $query->is_main_query() && ! empty( $_GET['feedzy_job_id'] ) ) {
    1632             $query->set(
    1633                 'meta_query', array(
    1634                     array(
    1635                         'key' => 'feedzy',
    1636                         'value' => 1,
    1637                     ),
    1638                     array(
    1639                         'key' => 'feedzy_job',
    1640                         'value' => $_GET['feedzy_job_id'],
    1641                     ),
    1642                 )
     1868            $meta_query = array(
     1869                array(
     1870                    'key' => 'feedzy',
     1871                    'value' => 1,
     1872                ),
     1873                array(
     1874                    'key' => 'feedzy_job',
     1875                    'value' => $_GET['feedzy_job_id'],
     1876                ),
    16431877            );
     1878
     1879            if ( ! empty( $_GET['feedzy_job_time'] ) ) {
     1880                $meta_query[] = array(
     1881                    'key' => 'feedzy_job_time',
     1882                    'value' => $_GET['feedzy_job_time'],
     1883                );
     1884            }
     1885
     1886            $query->set( 'meta_query', $meta_query );
    16441887        }
    16451888    }
  • feedzy-rss-feeds/trunk/includes/feedzy-rss-feeds.php

    r2369394 r2398010  
    105105    public function init() {
    106106        self::$plugin_name = 'feedzy-rss-feeds';
    107         self::$version = '3.4.3';
     107        self::$version = '3.5.0';
    108108        self::$instance->load_dependencies();
    109109        self::$instance->set_locale();
     
    189189        $plugin_ui = new Feedzy_Rss_Feeds_Ui( self::$instance->get_plugin_name(), self::$instance->get_version(), self::$instance->loader );
    190190        self::$instance->loader->add_action( 'admin_init', $plugin_ui, 'register_init' );
     191
    191192        self::$instance->loader->add_action( 'init', self::$instance->admin, 'register_post_type' );
    192193        self::$instance->loader->add_action( 'save_post', self::$instance->admin, 'save_feedzy_post_type_meta', 1, 2 );
     
    194195        self::$instance->loader->add_action( 'feedzy_post_http_teardown', self::$instance->admin, 'post_http_teardown', 10, 1 );
    195196        self::$instance->loader->add_action( 'admin_init', self::$instance->admin, 'admin_init', 10, 1 );
    196 
    197197        self::$instance->loader->add_action( 'manage_feedzy_categories_posts_custom_column', self::$instance->admin, 'manage_feedzy_category_columns', 10, 2 );
     198        self::$instance->loader->add_action( 'admin_menu', self::$instance->admin, 'feedzy_menu_pages' );
     199        self::$instance->loader->add_action( 'wp_ajax_get_tinymce_form', self::$instance->admin, 'get_tinymce_form' );
     200        self::$instance->loader->add_action( 'wp_enqueue_scripts', self::$instance->admin, 'enqueue_styles' );
     201        self::$instance->loader->add_action( 'admin_enqueue_scripts', self::$instance->admin, 'enqueue_styles_admin' );
     202        self::$instance->loader->add_action( 'wp_ajax_feedzy_categories', self::$instance->admin, 'ajax' );
     203
    198204        self::$instance->loader->add_filter( 'manage_feedzy_categories_posts_columns', self::$instance->admin, 'feedzy_category_columns' );
    199 
    200         self::$instance->loader->add_action( 'admin_menu', self::$instance->admin, 'feedzy_menu_pages' );
    201205        self::$instance->loader->add_filter( 'plugin_row_meta', self::$instance->admin, 'feedzy_filter_plugin_row_meta', 10, 2 );
    202206        self::$instance->loader->add_filter( 'feedzy_default_image', self::$instance->admin, 'feedzy_define_default_image' );
     
    211215        self::$instance->loader->add_filter( 'feedzy_get_feed_url', self::$instance->admin, 'get_feed_url', 10, 1 );
    212216        self::$instance->loader->add_filter( 'feedzy_get_settings', self::$instance->admin, 'get_settings', 10, 1 );
     217        self::$instance->loader->add_filter( 'feedzy_rss_feeds_logger_data', self::$instance->admin, 'get_usage_data', 10 );
     218        self::$instance->loader->add_filter( 'feedzy_check_source_validity', self::$instance->admin, 'check_source_validity', 10, 4 );
     219        self::$instance->loader->add_filter( 'feedzy_get_source_validity_error', self::$instance->admin, 'get_source_validity_error', 10, 3 );
     220        self::$instance->loader->add_filter( 'post_row_actions', self::$instance->admin, 'add_feedzy_category_actions', 10, 2 );
     221
     222        // do not load this with the loader as this will need a corresponding remove_filter also.
     223        add_filter( 'update_post_metadata', array( self::$instance->admin, 'validate_category_feeds' ), 10, 5 );
     224        add_filter( 'add_post_metadata', array( self::$instance->admin, 'validate_category_feeds' ), 10, 5 );
     225
    213226        add_shortcode( 'feedzy-rss', array( self::$instance->admin, 'feedzy_rss' ) );
    214         self::$instance->loader->add_action( 'wp_ajax_get_tinymce_form', self::$instance->admin, 'get_tinymce_form' );
    215         self::$instance->loader->add_action( 'wp_enqueue_scripts', self::$instance->admin, 'enqueue_styles' );
    216         self::$instance->loader->add_action( 'admin_enqueue_scripts', self::$instance->admin, 'enqueue_styles_admin' );
    217         self::$instance->loader->add_filter( 'feedzy_rss_feeds_logger_data', self::$instance->admin, 'get_usage_data', 10 );
    218227
    219228        $plugin_widget = new feedzy_wp_widget();
  • feedzy-rss-feeds/trunk/includes/views/css/import-metabox-edit.css

    r2345315 r2398010  
    16691669
    16701670.f1 {
    1671     padding: 25px;
     1671    padding: 30px;
     1672    padding-top: 10px;
    16721673    border-radius: 4px;
    16731674    background: #fff;
     
    16761677.f1 h3 {
    16771678    margin-top: 0;
    1678     margin-bottom: 5px;
     1679    margin-bottom: 10px;
    16791680    text-transform: uppercase;
     1681    background-color: #f1f1f1;
     1682    padding: 5px;
     1683    border-radius: 5px;
     1684    text-indent: 1%;
     1685}
     1686
     1687.f1 h3:nth-of-type(n+2) {
     1688    margin-top: 30px;
    16801689}
    16811690
     
    17761785
    17771786.f1 fieldset {
    1778     display: none;
    17791787    text-align: left;
    17801788}
     
    17901798input[type="text"],
    17911799input[type="password"],
     1800input[type="number"],
    17921801textarea,
    17931802textarea.form-control {
     
    18171826input[type="text"]:focus,
    18181827input[type="password"]:focus,
     1828input[type="number"]:focus,
    18191829textarea:focus,
    18201830textarea.form-control:focus {
     
    18271837input[type="text"]:-moz-placeholder,
    18281838input[type="password"]:-moz-placeholder,
     1839input[type="number"]:-moz-placeholder,
    18291840textarea:-moz-placeholder,
    18301841textarea.form-control:-moz-placeholder {
     
    18341845input[type="text"]:-ms-input-placeholder,
    18351846input[type="password"]:-ms-input-placeholder,
     1847input[type="number"]:-ms-input-placeholder,
    18361848textarea:-ms-input-placeholder,
    18371849textarea.form-control:-ms-input-placeholder {
     
    18411853input[type="text"]::-webkit-input-placeholder,
    18421854input[type="password"]::-webkit-input-placeholder,
     1855input[type="number"]::-webkit-input-placeholder,
    18431856textarea::-webkit-input-placeholder,
    18441857textarea.form-control::-webkit-input-placeholder {
     
    20872100.only-pro:hover select,
    20882101.only-pro:hover button,
     2102.only-pro:hover ~ button,
    20892103.only-pro:hover .chosen-container,
    20902104.only-pro:hover .chosen-single,
     2105.only-pro:hover .label_description,
    20912106.only-pro:hover select option {
    20922107    opacity: 0.3;
     
    21272142
    21282143.feedzy-highlight {
    2129     background-color: #ccff00;
     2144    background-color: #f1f1f1;
    21302145    padding: 1%;
    21312146}
     
    21342149    display: none;
    21352150}
     2151
     2152.feedzy-button-inside {
     2153    position: relative;
     2154}
     2155
     2156.feedzy-button-inside input {
     2157    outline: none;
     2158}
     2159
     2160.feedzy-button-inside input ~ a,
     2161.feedzy-button-inside input ~ a:hover,
     2162.feedzy-button-inside input ~ a:visited {
     2163    position: absolute;
     2164    right: 0px;
     2165    top: 0px;
     2166    border: none;
     2167    height: 43px;
     2168    width: 43px;
     2169    outline: none;
     2170    text-align: center;
     2171    font-weight: bold;
     2172    z-index: 999;
     2173    background-color: #f1f1f1;
     2174    text-decoration: none;
     2175    color: #e14c53;
     2176}
     2177
     2178.feedzy-button-inside input ~ a > i {
     2179    line-height: 44px;
     2180    outline: none;
     2181    border: none;
     2182}
     2183
     2184.form-group small i {
     2185    font-size: 15px;
     2186    line-height: 1.5;
     2187}
     2188
     2189#TB_ajaxContent ul {
     2190    list-style: decimal;
     2191    margin-left: 20px;
     2192}
     2193
     2194#TB_ajaxContent ul li {
     2195    padding: 5px !important;
     2196}
     2197
     2198
     2199#TB_ajaxContent p.loading-img {
     2200    text-align: center;
     2201}
     2202
     2203#TB_ajaxContent.loaded p.hide-when-loaded {
     2204    display: none;
     2205}
     2206
     2207#TB_ajaxContent div.dry_run span {
     2208    display: block;
     2209}
     2210
     2211#TB_ajaxContent div.dry_run span i.pass {
     2212    color: #149714;
     2213}
     2214
     2215#TB_ajaxContent div.dry_run span i.fail {
     2216    color: #ca4a1f;
     2217}
  • feedzy-rss-feeds/trunk/includes/views/import-metabox-edit.php

    r2345315 r2398010  
    77 */
    88?>
    9 <div class="f1">
    10 
    11     <h3><?php echo __( 'Import Setup Wizard', 'feedzy-rss-feeds' ); ?></h3>
    12     <p><?php echo __( 'Follow the steps to setup an import rule.', 'feedzy-rss-feeds' ); ?></p>
    13     <div class="f1-steps">
    14         <div class="f1-progress">
    15             <div class="f1-progress-line" data-now-value="16.66" data-number-of-steps="3" style="width: 16.66%;"></div>
     9<div class="f1" id="feedzy-import-form">
     10
     11    <h3><span class="dashicons dashicons-rss"></span> <?php echo __( 'Sources', 'feedzy-rss-feeds' ); ?></h3>
     12
     13        <div class="form-group">
     14            <label class="feedzy-sr-only"><?php echo __( 'RSS Feed sources (comma separated URLs or Feed Categories slug)', 'feedzy-rss-feeds' ); ?></label>
    1615        </div>
    17         <div class="f1-step active">
    18             <div class="f1-step-icon"><span class="dashicons dashicons-rss"></span></div>
    19             <p><?php echo __( 'Sources', 'feedzy-rss-feeds' ); ?></p>
    20         </div>
    21         <div class="f1-step">
    22             <div class="f1-step-icon"><span class="dashicons dashicons-filter"></span></div>
    23             <p><?php echo __( 'Filters', 'feedzy-rss-feeds' ); ?></p>
    24         </div>
    25         <div class="f1-step">
    26             <div class="f1-step-icon"><span class="dashicons dashicons-randomize"></span></div>
    27             <p><?php echo __( 'Assign', 'feedzy-rss-feeds' ); ?></p>
    28         </div>
    29     </div>
    30 
    31     <fieldset class="feedzy-screen1">
    32         <h4><?php echo __( 'Feed sources:', 'feedzy-rss-feeds' ); ?></h4>
    33         <div class="form-group">
    34             <label class="feedzy-sr-only"><?php echo __( 'Feedzy RSS Feed sources (comma separated URLs or Feed Categories slug)', 'feedzy-rss-feeds' ); ?></label>
    35         </div>
     16
     17        <?php echo $invalid_source_msg; ?>
     18
    3619        <div class="form-group input-group">
    37             <input type="text" name="feedzy_meta_data[source]" placeholder="<?php echo __( 'Source', 'feedzy-rss-feeds' ); ?>" class="form-control  " value="<?php echo $source; ?>"/>
     20            <div class="feedzy-button-inside">
     21                <input type="text" id="feedzy-import-source" title="<?php _e( 'Make sure you validate the feed by using the validate button on the right', 'feedzy-rss-feeds' ); ?>" name="feedzy_meta_data[source]" placeholder="<?php echo __( 'Source', 'feedzy-rss-feeds' ); ?>" class="form-control" value="<?php echo $source; ?>"/>
     22                <a class="feedzy-inside" target="_blank" data-href-base="https://validator.w3.org/feed/check.cgi?url=" href="#" title="<?php _e( 'Validate Feed', 'feedzy-rss-feeds' ); ?>"><i title="<?php _e( 'Validate Feed', 'feedzy-rss-feeds' ); ?>" class="dashicons dashicons-external"></i></a>
     23            </div>
     24            <small><i class="dashicons dashicons-lightbulb"></i><?php _e( 'Make sure to use the validate button. Invalid feeds may not import anything.', 'feedzy-rss-feeds' ); ?></small>
    3825            <div class="input-group-btn">
    3926            <?php
     
    4128                ?>
    4229                <button type="button" class="btn btn-add-fields dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
    43                     <?php echo __( 'Add Feed Category', 'feedzy-rss-feeds' ); ?> <span class="dashicons dashicons-arrow-down-alt2"></span>
     30                    <?php echo __( 'Use Feed Category', 'feedzy-rss-feeds' ); ?> <span class="dashicons dashicons-arrow-down-alt2"></span>
    4431                </button>
    4532                <div class="dropdown-menu dropdown-menu-right">
     
    6451            </div>
    6552        </div>
    66         <div class="f1-buttons">
    67             <button type="button" class="btn btn-next"><?php echo __( 'Next', 'feedzy-rss-feeds' ); ?></button>
     53
     54    <h3><span class="dashicons dashicons-filter"></span> <?php echo __( 'Filters', 'feedzy-rss-feeds' ); ?></h3>
     55
     56        <div class="feedzy-rows">
     57            <div class="feedzy-row <?php echo apply_filters( 'feedzy_upsell_class', '' ); ?>">
     58                <?php echo apply_filters( 'feedzy_upsell_content', '' ); ?>
     59                <div class="label_description">
     60                    <label class="feedzy-sr-only"><?php echo __( 'Display item only if the title contains specific keyword(s)', 'feedzy-rss-feeds' ); ?></label>
     61                    <div>
     62                        <small><?php echo sprintf( __( 'You can provide comma-separated words. Remember, these words are %1$scase sensitive%2$s .e.g. News, news, STOCK', 'feedzy-rss-feeds' ), '<b>', '</b>' ); ?></small>
     63                    </div>
     64                </div>
     65                <div class="feedzy-separator"></div>
     66                <div class="form-group input-group form_item">
     67                    <input type="text" name="feedzy_meta_data[inc_key]" placeholder="<?php echo __( '(eg. news, sports etc.)', 'feedzy-rss-feeds' ); ?>" class="form-control" value="<?php echo $inc_key; ?>"/>
     68                </div>
     69            </div>
     70
     71            <div class="feedzy-row <?php echo apply_filters( 'feedzy_upsell_class', '' ); ?>">
     72                <?php echo apply_filters( 'feedzy_upsell_content', '' ); ?>
     73                <div class="label_description">
     74                    <label class="feedzy-sr-only"><?php echo __( 'Exclude item if the title contains specific keyword(s)', 'feedzy-rss-feeds' ); ?></label>
     75                    <div>
     76                        <small><?php echo sprintf( __( 'You can provide comma-separated words. Remember, these words are %1$scase sensitive%2$s .e.g. News, news, STOCK', 'feedzy-rss-feeds' ), '<b>', '</b>' ); ?></small>
     77                    </div>
     78                </div>
     79                <div class="feedzy-separator"></div>
     80                <div class="form-group input-group form_item">
     81                    <input type="text" name="feedzy_meta_data[exc_key]" placeholder="<?php echo __( '(eg. news, sports etc.)', 'feedzy-rss-feeds' ); ?>" class="form-control" value="<?php echo $exc_key; ?>"/>
     82                </div>
     83            </div>
     84
     85            <div class="feedzy-row">
     86                <div class="label_description">
     87                    <label class="feedzy-sr-only"><?php _e( 'How many feed items to import from the source?', 'feedzy-rss-feeds' ); ?></label>
     88                    <div>
     89                        <small><?php echo sprintf( __( 'If you choose a high number, please check that you configuration can support it or your imports may fail.', 'feedzy-rss-feeds' ), '<b>', '</b>' ); ?></small>
     90                    </div>
     91                </div>
     92                <div class="feedzy-separator"></div>
     93                <div class="form-group input-group form_item">
     94                    <input type="number" min="0" max="9999" id="feedzy_item_limit" name="feedzy_meta_data[import_feed_limit]" class="form-control" value="<?php echo $import_feed_limit; ?>"/>
     95                </div>
     96            </div>
     97
     98            <div class="feedzy-row <?php echo apply_filters( 'feedzy_upsell_class', '' ); ?>">
     99                <?php echo apply_filters( 'feedzy_upsell_content', '' ); ?>
     100                <div class="label_description">
     101                    <label class="feedzy-sr-only"><?php _e( 'Automatically delete the posts created for this import after how many days?', 'feedzy-rss-feeds' ); ?></label>
     102                    <div>
     103                        <small><?php _e( 'Helpful if you want to remove stale or old items automatically. If you choose 0, the imported items will never be deleted.', 'feedzy-rss-feeds' ); ?></small>
     104                    </div>
     105                </div>
     106                <div class="feedzy-separator"></div>
     107                <div class="form-group input-group form_item">
     108                    <input type="number" min="0" max="9999" id="feedzy_delete_days" name="feedzy_meta_data[import_feed_delete_days]" class="form-control" value="<?php echo $import_feed_delete_days; ?>"/>
     109                </div>
     110            </div>
     111
    68112        </div>
    69     </fieldset>
    70 
    71     <fieldset class="feedzy-screen2">
    72         <h4><?php echo __( 'Feed filters:', 'feedzy-rss-feeds' ); ?></h4>
    73         <div class="form-group <?php echo apply_filters( 'feedzy_upsell_class', '' ); ?>">
    74             <?php echo apply_filters( 'feedzy_upsell_content', '' ); ?>
    75             <label class="feedzy-sr-only"><?php echo __( 'Only display item if title contains specific keyword(s) (comma-separated list/case sensitive).', 'feedzy-rss-feeds' ); ?></label>
    76             <input type="text" name="feedzy_meta_data[inc_key]" placeholder="<?php echo __( '(eg. news, sports etc.)', 'feedzy-rss-feeds' ); ?>" class="form-control" value="<?php echo $inc_key; ?>"/>
    77         </div>
    78         <div class="form-group <?php echo apply_filters( 'feedzy_upsell_class', '' ); ?>">
    79             <?php echo apply_filters( 'feedzy_upsell_content', '' ); ?>
    80             <label class="feedzy-sr-only"><?php echo __( 'Exclude items if title contains specific keyword(s) (comma-separated list/case sensitive).', 'feedzy-rss-feeds' ); ?></label>
    81             <input type="text" name="feedzy_meta_data[exc_key]" placeholder="<?php echo __( '(eg. news, sports etc.)', 'feedzy-rss-feeds' ); ?>" class="form-control" value="<?php echo $exc_key; ?>"/>
    82         </div>
    83         <div class="form-group">
    84             <label class="feedzy-sr-only"><?php _e( 'How many feed items to process from the feed?', 'feedzy-rss-feeds' ); ?></label>
    85             <select id="feedzy_item_limit" class="form-control feedzy-chosen" name="feedzy_meta_data[import_feed_limit]" >
    86                 <?php
    87                 $limits = apply_filters( 'feedzy_items_limit', range( 10, 100, 10 ), $post );
    88                 $limits[] = 9999;
    89                 if ( '' === $import_feed_limit ) {
    90                     $import_feed_limit = 20;
    91                 }
    92                 foreach ( $limits as $v ) {
    93                     $selected = '';
    94                     // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
    95                     if ( $v == $import_feed_limit ) {
    96                         $selected = 'selected';
    97                     }
    98                     $display = $v;
    99                     if ( $v === 9999 ) {
    100                         $display = __( 'All (check that your server configuration can support this)', 'feedzy-rss-feeds' );
    101                         if ( ! feedzy_is_pro() ) {
    102                             $display = __( 'More options available in PRO.', 'feedzy-rss-feeds' );
    103                             $selected = 'disabled';
    104                             $v = '';
    105                         }
    106                     }
    107                     ?>
    108                     <option value="<?php echo $v; ?>" <?php echo $selected; ?>><?php echo $display; ?></option>
    109                     <?php
    110                 }
    111                 ?>
    112             </select>
    113         </div>
    114         <div class="form-group <?php echo apply_filters( 'feedzy_upsell_class', '' ); ?>">
    115             <?php echo apply_filters( 'feedzy_upsell_content', '' ); ?>
    116             <label class="feedzy-sr-only"><?php _e( 'Delete the posts created for this import after how many days?', 'feedzy-rss-feeds' ); ?></label>
    117             <select id="feedzy_delete_limit" class="form-control feedzy-chosen" name="feedzy_meta_data[import_feed_delete_days]" >
    118                 <?php
    119                 // 0 is never delete.
    120                 $days = apply_filters( 'feedzy_items_delete_days', range( 0, 100, 1 ), $post );
    121                 if ( '' === $import_feed_delete_days ) {
    122                     $import_feed_delete_days = 0;
    123                 }
    124                 foreach ( $days as $v ) {
    125                     $selected = '';
    126                     if ( $v === $import_feed_delete_days ) {
    127                         $selected = 'selected';
    128                     }
    129                     $display = $v;
    130                     if ( $v === 0 ) {
    131                         $display = __( 'Never', 'feedzy-rss-feeds' );
    132                     }
    133                     ?>
    134                     <option value="<?php echo $v; ?>" <?php echo $selected; ?>><?php echo $display; ?></option>
    135                     <?php
    136                 }
    137                 ?>
    138             </select>
    139         </div>
    140         <div class="f1-buttons">
    141             <button type="button" class="btn btn-previous"><?php echo __( 'Previous', 'feedzy-rss-feeds' ); ?></button>
    142             <button type="button" class="btn btn-next"><?php echo __( 'Next', 'feedzy-rss-feeds' ); ?></button>
    143         </div>
    144     </fieldset>
    145 
    146     <fieldset class="feedzy-screen3">
    147         <h4><?php echo __( 'Feed assign:', 'feedzy-rss-feeds' ); ?></h4>
    148         <p><?php echo __( 'Map post elements to custom post from feed imports.', 'feedzy-rss-feeds' ); ?></p>
     113
     114
     115    <h3><span class="dashicons dashicons-feedback"></span> <?php echo __( 'Assign Elements', 'feedzy-rss-feeds' ); ?></h3>
     116
     117        <p><?php _e( 'Using magic tags, specify what part(s) of the source should form part of the imported post.', 'feedzy-rss-feeds' ); ?>
     118        <?php if ( false === apply_filters( 'feedzy_is_license_of_type', false, 'agency' ) ) { ?>
     119            <?php echo sprintf( __( 'The magic tags that are greyed out and disabled are unavailable for your current license. You can consider %1$supgrading%2$s.', 'feedzy-rss-feeds' ), '<a href="' . FEEDZY_UPSELL_LINK . '" target="_blank" title="' . __( 'Upgrade', 'feedzy-rss-feeds' ) . '">', '</a>' ); ?>
     120        <?php } ?>
     121        </p>
    149122
    150123        <div class="feedzy-rows">
     
    183156                <div class="label_description">
    184157                    <label class="feedzy-sr-only" for="f1-post-type"><?php echo __( 'Post Taxonomy', 'feedzy-rss-feeds' ); ?></label><br/>
    185                     <small><?php _e( 'Assign to a taxonomy term (eg. "Category", "Tags" etc.)', 'feedzy-rss-feeds' ); ?></small>
     158                    <small><?php _e( 'Assign to a taxonomy (eg. "Post Category", "Post Tag" etc.). Leave blank, if unsure.', 'feedzy-rss-feeds' ); ?></small>
    186159                </div>
    187160                <div class="feedzy-separator dashicons dashicons-leftright"></div>
     
    229202                    $magic_tags = apply_filters( 'feedzy_get_service_magic_tags', $magic_tags, 'title' );
    230203
    231                     echo __( 'The title for the generated post. You can use ', 'feedzy-rss-feeds' ) .
    232                     '<b>[#' . implode( ']</b>, <b>[#', $magic_tags ) . ']</b>' .
    233                         __( ' tags to append the feed item title to the generated post title or mix and match your own.', 'feedzy-rss-feeds' );
     204                    _e( 'The title for the generated post. This field is mandatory - without this, a post will not be created.', 'feedzy-rss-feeds' );
    234205                    ?>
    235206                    </small>
     
    253224                    <small>
    254225                        <?php
    255                         echo __( 'The date for the generated post. You can use ', 'feedzy-rss-feeds' ) .
    256                             '<b>[#item_date]</b>, <b>[#post_date]</b>' .
    257                             __( ' tags or leave blank.', 'feedzy-rss-feeds' );
     226                            _e( 'The date for the generated post. Leave blank, if unsure.', 'feedzy-rss-feeds' );
    258227                        ?>
    259228                    </small>
     
    293262                    $magic_tags = apply_filters( 'feedzy_get_service_magic_tags', $magic_tags, 'content' );
    294263
    295                     echo __( 'The content for the generated post. You can use ', 'feedzy-rss-feeds' ) .
    296                     '<b>[#' . implode( ']</b>, <b>[#', $magic_tags ) . ']</b>' .
    297                         __( ' tags to append the feed item content for the generated post content.', 'feedzy-rss-feeds' );
     264                    _e( 'The content for the generated post. This field is mandatory - without this, a post will not be created.', 'feedzy-rss-feeds' );
    298265                    ?>
    299266                    </small>
     
    302269                    <?php
    303270                    if ( apply_filters( 'feedzy_is_license_of_type', false, 'business' ) ) {
    304                         echo sprintf( __( 'You can add custom magic tags to extract custom elements from your feed as explained %1$shere%2$s. This will work only for single-feeds (not if you have specified a feed category that contains multiple feeds).', 'feedzy-rss-feeds' ), '<a href="https://docs.themeisle.com/article/977-how-do-i-extract-values-from-custom-tags-in-feedzy" target="_blank">', '</a>' );
     271                        echo sprintf( __( 'You can add custom magic tags to extract custom elements from your feed as explained %1$shere%2$s. This will work only for single-feeds (i.e. not if you have specified a feed category that contains multiple feeds or using comma-separated feeds in the source).', 'feedzy-rss-feeds' ), '<a href="https://docs.themeisle.com/article/977-how-do-i-extract-values-from-custom-tags-in-feedzy" target="_blank">', '</a>' );
    305272                    } else {
    306273                        echo sprintf( __( 'Want to extract custom elements from your feed as explained %1$shere%2$s? Upgrade your %3$slicense%4$s today!', 'feedzy-rss-feeds' ), '<a href="https://docs.themeisle.com/article/977-how-do-i-extract-values-from-custom-tags-in-feedzy" target="_blank">', '</a>', '<a href="' . FEEDZY_UPSELL_LINK . '" target="_blank">', '</a>' );
     
    331298                    <small>
    332299                        <?php
    333                         echo __( 'The URL for the featured image. You can use ', 'feedzy-rss-feeds' ) .
    334                             '<b>[#item_image]</b>' .
    335                             __( ' tag, use your own URL or leave it empty. (*optional)', 'feedzy-rss-feeds' );
     300                        _e( 'The URL for the featured image. You can use the magic tags, use your own URL or leave it empty.', 'feedzy-rss-feeds' );
    336301                        ?>
    337302                    </small>
     
    350315                </div>
    351316            </div>
    352             <div class="feedzy-row">
     317            <div class="feedzy-row <?php echo apply_filters( 'feedzy_upsell_class', '' ); ?>">
     318                <?php echo apply_filters( 'feedzy_upsell_content', '' ); ?>
    353319                <div class="label_description">
    354320                    <label class="feedzy-sr-only" for="f1-post-content"><?php echo __( 'Post Author', 'feedzy-rss-feeds' ); ?></label><br/>
    355321                    <small>
    356322                        <?php
    357                          _e( 'Show the original author', 'feedzy-rss-feeds' );
    358                         ?>
    359                     </small>
    360                 </div>
    361                 <div class="feedzy-separator dashicons dashicons-leftright"></div>
    362                 <div class="form-group input-group form_item <?php echo apply_filters( 'feedzy_upsell_class', '' ); ?>">
    363                     <?php echo apply_filters( 'feedzy_upsell_content', '' ); ?>
    364                     <div>
    365                         <input type="checkbox" name="feedzy_meta_data[import_link_author_admin]" id="import_link_author_admin" value="yes" <?php echo $import_link_author[0]; ?>/>
    366                         <label class="feedzy-inline" for="import_link_author_admin"><?php echo __( 'In the backend', 'feedzy-rss-feeds' ); ?></label>
    367                     </div>
    368                     <div>
    369                         <input type="checkbox" name="feedzy_meta_data[import_link_author_public]" id="import_link_author_public" value="yes" <?php echo $import_link_author[1]; ?>/>
    370                         <label class="feedzy-inline" for="import_link_author_public"><?php echo __( 'Link to the original post in the frontend', 'feedzy-rss-feeds' ); ?></label>
     323                         _e( 'Show the original author of the source item.', 'feedzy-rss-feeds' );
     324                        ?>
     325                    </small>
     326                </div>
     327                <div class="feedzy-separator dashicons dashicons-leftright"></div>
     328                <div class="form-group input-group form_item">
     329                    <div>
     330                        <input id="feedzy-toggle_author_admin" name="feedzy_meta_data[import_link_author_admin]" class="feedzy-toggle feedzy-toggle-round" type="checkbox" value="yes" <?php echo $import_link_author[0]; ?>>
     331                        <label for="feedzy-toggle_author_admin" class="feedzy-inline"></label>
     332                        <label class="feedzy-inline" style="margin-left: 10px;" for="import_link_author_admin"><?php echo __( 'In the backend, on the post listing screen', 'feedzy-rss-feeds' ); ?></label>
     333                    </div>
     334                    <div>
     335                        <input id="feedzy-toggle_author_public" name="feedzy_meta_data[import_link_author_public]" class="feedzy-toggle feedzy-toggle-round" type="checkbox" value="yes" <?php echo $import_link_author[1]; ?>>
     336                        <label for="feedzy-toggle_author_public" class="feedzy-inline"></label>
     337                        <label class="feedzy-inline" style="margin-left: 10px;" for="import_link_author_public"><?php echo __( 'In the frontend, link to the original post', 'feedzy-rss-feeds' ); ?></label>
    371338                    </div>
    372339                </div>
     
    409376        <div class="f1-buttons">
    410377            <input type="hidden" id="custom_post_status" name="custom_post_status" value="draft" />
    411             <button type="button" class="btn btn-previous"><?php echo __( 'Previous', 'feedzy-rss-feeds' ); ?></button>
     378            <button type="button" id="preflight" name="check" class="btn btn-previous" value="Check" title="<?php _e( 'Click to see what items will be imported from the source, according to the filters specified', 'feedzy-rss-feeds' ); ?>"><?php _e( 'Dry Run', 'feedzy-rss-feeds' ); ?></button>
    412379            <?php
    413380            if ( $post_status === 'publish' ) {
    414381                ?>
    415                 <button type="submit" name="publish" class="btn btn-submit" value="Publish"><?php echo __( 'Save', 'feedzy-rss-feeds' ); ?></button>
     382                <button type="submit" name="publish" class="btn btn-submit" value="Publish"><?php _e( 'Save', 'feedzy-rss-feeds' ); ?></button>
    416383                <?php
    417384            } else {
    418385                ?>
    419                 <button type="submit" name="save" class="btn btn-submit" value="Save Draft" style="float: none;"><?php echo __( 'Save', 'feedzy-rss-feeds' ); ?></button>
    420                 <button type="submit" name="publish" class="btn btn-submit btn-activate" value="Publish" ><?php echo __( 'Save & Activate', 'feedzy-rss-feeds' ); ?></button>
     386                <button type="submit" name="save" class="btn btn-submit" value="Save Draft" style="float: none;"><?php _e( 'Save', 'feedzy-rss-feeds' ); ?></button>
     387                <button type="submit" name="publish" class="btn btn-submit btn-activate" value="Publish" ><?php _e( 'Save & Activate', 'feedzy-rss-feeds' ); ?></button>
    421388                <?php
    422389            }
    423390            ?>
    424391        </div>
    425     </fieldset>
    426392</div>
    427393
  • feedzy-rss-feeds/trunk/includes/views/js/import-metabox-edit.js

    r2345315 r2398010  
    66 * @package feedzy-rss-feeds-pro
    77 */
    8 /* global jQuery, ajaxurl, feedzy */
     8/* global jQuery, ajaxurl, feedzy, tb_show */
    99(function($){
    1010    function scroll_to_class(element_class, removed_height) {
     
    6363
    6464    function update_status() {
     65        var toggle = $( this );
    6566        var post_id = $( this ).val();
    6667        var status = $( this ).is( ':checked' );
     
    7475        };
    7576
    76         // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
    77         $.post( ajaxurl, data, function() {} );
     77        showSpinner(toggle);
     78        $.ajax({
     79            url: ajaxurl,
     80            data: data,
     81            method: 'POST',
     82            success: function(data){
     83                if( ! data.success && status ) {
     84                    toggle.parents('tr').find('td.feedzy-source').find('.feedzy-error-critical').remove();
     85                    toggle.parents('tr').find('td.feedzy-source').append($(data.data.msg));
     86                    toggle.prop( 'checked', false );
     87                }
     88            },
     89            complete: function(){
     90                hideSpinner(toggle);
     91            }
     92        });
    7893        return true;
    7994    }
     
    143158
    144159    $( document ).ready(function() {
     160        initImportScreen();
     161        initSummary();
     162    });
     163
     164    function initImportScreen() {
    145165        $( 'button.btn-submit' ).on( 'click', function( e ) {
    146166            $( window ).unbind( 'beforeunload' );
     
    213233        });
    214234
    215         initSummary();
    216 
    217     });
     235        $('#feedzy-import-source ~ a').on('click', function(e){
     236            let $url = $('#feedzy-import-source').val();
     237            let $anchor = $(this);
     238            $anchor.attr('href', $anchor.attr('data-href-base') + $url);
     239        });
     240
     241        $('#preflight').on('click', function(e){
     242            e.preventDefault();
     243            var $fields = {};
     244            // collect all elements.
     245            $('#feedzy-import-form').find(':input').each(function(index, element){
     246                if ( 'undefined' === typeof $(element).attr('name') ) {
     247                    return;
     248                }
     249                $fields[ $(element).attr('name') ] = $(element).val();
     250            });
     251            tb_show( feedzy.i10n.dry_run_title, 'TB_inline?' );
     252            $('#TB_ajaxContent').html(feedzy.i10n.dry_run_loading);
     253            $.ajax({
     254                url     : ajaxurl,
     255                method  : 'post',
     256                data    : {
     257                    security    : feedzy.ajax.security,
     258                    fields       : $.param($fields),
     259                    action      : 'feedzy',
     260                    _action      : 'dry_run'
     261                },
     262                success: function(data){
     263                    $('#TB_ajaxContent').addClass('loaded');
     264                    $('#TB_ajaxContent div').html(data.data.output);
     265                }
     266            });
     267        });
     268    }
    218269
    219270    function initSummary() {
     271        $('tr.type-feedzy_imports').each(function(i, e){
     272            var $lastRunData = $(e).find('script.feedzy-last-run-data').html();
     273            $($lastRunData).insertAfter(e);
     274        });
     275
    220276        // pop-ups for informational text
    221277        $( '.feedzy-dialog' ).dialog({
     
    241297            e.preventDefault();
    242298            var button = $(this);
    243             showSpinner(button);
    244             button.parent().find('.feedzy-error').remove();
     299            button.val(feedzy.i10n.importing);
     300
     301            var numberRow = button.parents('tr').find('~ tr.feedzy-import-status-row:first').find('td tr:first');
     302            numberRow.find('td').hide();
     303            numberRow.find('td:first').addClass('feedzy_run_now_msg').attr('colspan', 5).html(feedzy.i10n.importing).show();
     304
    245305            $.ajax({
    246306                url     : ajaxurl,
     
    253313                },
    254314                success: function(data){
    255                     hideSpinner(button);
    256                     button.after($('<div class="feedzy-error feedzy-error-critical">' + data.data.msg + '</div>'));
     315                    numberRow.find('td:first').html(data.data.msg);
     316                },
     317                complete: function(){
     318                    button.val(feedzy.i10n.run_now);
    257319                }
    258320            });
     
    284346                },
    285347                success: function(){
     348                    location.reload();
     349                },
     350                complete: function(){
    286351                    hideSpinner(element);
    287352                }
  • feedzy-rss-feeds/trunk/readme.md

    r2369394 r2398010  
    462462
    463463 == Changelog ==
     464### 3.5.0 - 2020-10-12  ###
     465
     466* [Feat] Improved interface for adding new imports and for the imports listing page
     467* [Feat] Improved checks for feeds validity
     468
     469
    464470### 3.4.3 - 2020-08-26  ###
    465471
  • feedzy-rss-feeds/trunk/readme.txt

    r2369394 r2398010  
    462462
    463463 == Changelog ==
     464= 3.5.0 - 2020-10-12  =
     465
     466* [Feat] Improved interface for adding new imports and for the imports listing page
     467* [Feat] Improved checks for feeds validity
     468
     469
    464470= 3.4.3 - 2020-08-26  =
    465471
  • feedzy-rss-feeds/trunk/themeisle-hash.json

    r2369394 r2398010  
    1 {"feedzy-rss-feed.php":"5179c1de2880c3ac87bb30a1ce26307b","index.php":"71c0755260138a4b7b2182c3c61179f6","uninstall.php":"cdb21f8648e005cbb9c73481d1750186"}
     1{"feedzy-rss-feed.php":"b987a3ed66b1465c85d317884f5a00ff","index.php":"71c0755260138a4b7b2182c3c61179f6","uninstall.php":"cdb21f8648e005cbb9c73481d1750186"}
  • feedzy-rss-feeds/trunk/vendor/autoload.php

    r2369394 r2398010  
    55require_once __DIR__ . '/composer' . '/autoload_real.php';
    66
    7 return ComposerAutoloaderInit27d7cef882b95754cf5c8cd833e05014::getLoader();
     7return ComposerAutoloaderInit21a3a7dd973af49e9322f7c49b7edf5c::getLoader();
  • feedzy-rss-feeds/trunk/vendor/autoload_52.php

    r2369394 r2398010  
    55require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
    66
    7 return ComposerAutoloaderInitd0e413725483a6c1189ceadcfb8e99f3::getLoader();
     7return ComposerAutoloaderInit33ada9a75367c67d82882bee194c98e4::getLoader();
  • feedzy-rss-feeds/trunk/vendor/composer/autoload_real.php

    r2369394 r2398010  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit27d7cef882b95754cf5c8cd833e05014
     5class ComposerAutoloaderInit21a3a7dd973af49e9322f7c49b7edf5c
    66{
    77    private static $loader;
     
    2020        }
    2121
    22         spl_autoload_register(array('ComposerAutoloaderInit27d7cef882b95754cf5c8cd833e05014', 'loadClassLoader'), true, true);
     22        spl_autoload_register(array('ComposerAutoloaderInit21a3a7dd973af49e9322f7c49b7edf5c', 'loadClassLoader'), true, true);
    2323        self::$loader = $loader = new \Composer\Autoload\ClassLoader();
    24         spl_autoload_unregister(array('ComposerAutoloaderInit27d7cef882b95754cf5c8cd833e05014', 'loadClassLoader'));
     24        spl_autoload_unregister(array('ComposerAutoloaderInit21a3a7dd973af49e9322f7c49b7edf5c', 'loadClassLoader'));
    2525
    2626        $map = require __DIR__ . '/autoload_namespaces.php';
     
    4343        $includeFiles = require __DIR__ . '/autoload_files.php';
    4444        foreach ($includeFiles as $fileIdentifier => $file) {
    45             composerRequire27d7cef882b95754cf5c8cd833e05014($fileIdentifier, $file);
     45            composerRequire21a3a7dd973af49e9322f7c49b7edf5c($fileIdentifier, $file);
    4646        }
    4747
     
    5050}
    5151
    52 function composerRequire27d7cef882b95754cf5c8cd833e05014($fileIdentifier, $file)
     52function composerRequire21a3a7dd973af49e9322f7c49b7edf5c($fileIdentifier, $file)
    5353{
    5454    if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
  • feedzy-rss-feeds/trunk/vendor/composer/autoload_real_52.php

    r2369394 r2398010  
    33// autoload_real_52.php generated by xrstf/composer-php52
    44
    5 class ComposerAutoloaderInitd0e413725483a6c1189ceadcfb8e99f3 {
     5class ComposerAutoloaderInit33ada9a75367c67d82882bee194c98e4 {
    66    private static $loader;
    77
     
    2020        }
    2121
    22         spl_autoload_register(array('ComposerAutoloaderInitd0e413725483a6c1189ceadcfb8e99f3', 'loadClassLoader'), true /*, true */);
     22        spl_autoload_register(array('ComposerAutoloaderInit33ada9a75367c67d82882bee194c98e4', 'loadClassLoader'), true /*, true */);
    2323        self::$loader = $loader = new xrstf_Composer52_ClassLoader();
    24         spl_autoload_unregister(array('ComposerAutoloaderInitd0e413725483a6c1189ceadcfb8e99f3', 'loadClassLoader'));
     24        spl_autoload_unregister(array('ComposerAutoloaderInit33ada9a75367c67d82882bee194c98e4', 'loadClassLoader'));
    2525
    2626        $vendorDir = dirname(dirname(__FILE__));
Note: See TracChangeset for help on using the changeset viewer.