Skip to content

Commit

Permalink
Merge pull request #1014 from Codeinwp/fix/various-improvements
Browse files Browse the repository at this point in the history
Various Improvements
  • Loading branch information
selul authored Dec 12, 2024
2 parents 0db930e + b15dee8 commit a2ed420
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 30 deletions.
26 changes: 13 additions & 13 deletions includes/admin/feedzy-rss-feeds-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,16 +277,16 @@ public function enqueue_scripts() {
*/
public function register_post_type() {
$labels = array(
'name' => __( 'Feed Categories', 'feedzy-rss-feeds' ),
'singular_name' => __( 'Feed Category', 'feedzy-rss-feeds' ),
'add_new' => __( 'Add Category', 'feedzy-rss-feeds' ),
'add_new_item' => __( 'Add Category', 'feedzy-rss-feeds' ),
'edit_item' => __( 'Edit Category', 'feedzy-rss-feeds' ),
'new_item' => __( 'New Feed Category', 'feedzy-rss-feeds' ),
'view_item' => __( 'View Category', 'feedzy-rss-feeds' ),
'search_items' => __( 'Search Category', 'feedzy-rss-feeds' ),
'not_found' => __( 'No categories found', 'feedzy-rss-feeds' ),
'not_found_in_trash' => __( 'No categories in the trash', 'feedzy-rss-feeds' ),
'name' => __( 'Feed Groups', 'feedzy-rss-feeds' ),
'singular_name' => __( 'Feed Group', 'feedzy-rss-feeds' ),
'add_new' => __( 'Add Group', 'feedzy-rss-feeds' ),
'add_new_item' => __( 'Add Group', 'feedzy-rss-feeds' ),
'edit_item' => __( 'Edit Group', 'feedzy-rss-feeds' ),
'new_item' => __( 'New Feed Group', 'feedzy-rss-feeds' ),
'view_item' => __( 'View Group', 'feedzy-rss-feeds' ),
'search_items' => __( 'Search Group', 'feedzy-rss-feeds' ),
'not_found' => __( 'No groups found', 'feedzy-rss-feeds' ),
'not_found_in_trash' => __( 'No groups in the trash', 'feedzy-rss-feeds' ),
);
$supports = array(
'title',
Expand Down Expand Up @@ -346,7 +346,7 @@ public function register_admin_capabilities() {
public function add_feedzy_post_type_metaboxes() {
add_meta_box(
'feedzy_category_feeds',
__( 'Category Feeds', 'feedzy-rss-feeds' ),
__( 'Group Feeds', 'feedzy-rss-feeds' ),
array(
$this,
'feedzy_category_feed',
Expand Down Expand Up @@ -413,7 +413,7 @@ public function feedzy_category_feed() {
. '</strong><br/><br/>'
. $invalid
. '<textarea name="feedzy_category_feed" rows="15" class="widefat" placeholder="' . __( 'Place your URL\'s here followed by a comma.', 'feedzy-rss-feeds' ) . '" >' . $feed . '</textarea>
<p><a href="' . esc_url( 'https://docs.themeisle.com/article/1119-feedzy-rss-feeds-documentation#categories' ) . '" target="_blank">' . __( 'Learn how to organize feeds in Categories', 'feedzy-rss-feeds' ) . '</a></p>
<p><a href="' . esc_url( 'https://docs.themeisle.com/article/1119-feedzy-rss-feeds-documentation#categories' ) . '" target="_blank">' . __( 'Learn how to organize feeds in Groups', 'feedzy-rss-feeds' ) . '</a></p>
';
echo wp_kses( $output, apply_filters( 'feedzy_wp_kses_allowed_html', array() ) );
}
Expand Down Expand Up @@ -482,7 +482,7 @@ public function save_feedzy_post_type_meta( $post_id, $post ) {
* @return array
*/
public function feedzy_category_columns( $columns ) {
$columns['title'] = __( 'Category Title', 'feedzy-rss-feeds' );
$columns['title'] = __( 'Group Title', 'feedzy-rss-feeds' );
if ( $new_columns = $this->array_insert_before( 'date', $columns, 'slug', __( 'Slug', 'feedzy-rss-feeds' ) ) ) {
$columns = $new_columns;
} else {
Expand Down
15 changes: 9 additions & 6 deletions includes/admin/feedzy-rss-feeds-import.php
Original file line number Diff line number Diff line change
Expand Up @@ -668,10 +668,10 @@ public function manage_feedzy_import_columns( $column, $post_id ) {
if ( in_array( $src_path, $amazon_hosts, true ) ) {
$src = sprintf( '%s: %s%s%s', __( 'Amazon Product Advertising API', 'feedzy-rss-feeds' ), '<a>', $src, '</a>' );
} else {
$src = sprintf( '%s: %s%s%s', __( 'Feed Category', 'feedzy-rss-feeds' ), '<a href="' . admin_url( 'edit.php?post_type=feedzy_categories' ) . '" target="_blank">', $src, '</a>' );
$src = sprintf( '%s: %s%s%s', __( 'Feed Group', 'feedzy-rss-feeds' ), '<a href="' . admin_url( 'edit.php?post_type=feedzy_categories' ) . '" target="_blank">', $src, '</a>' );
}
} else {
$src = sprintf( '%s: %s%s%s', __( 'Feed Category', 'feedzy-rss-feeds' ), '<a href="' . admin_url( 'edit.php?post_type=feedzy_categories' ) . '" target="_blank">', $src, '</a>' );
$src = sprintf( '%s: %s%s%s', __( 'Feed Group', 'feedzy-rss-feeds' ), '<a href="' . admin_url( 'edit.php?post_type=feedzy_categories' ) . '" target="_blank">', $src, '</a>' );
}
} else {
// else link it to the feed but shorten it if it is too long.
Expand Down Expand Up @@ -1230,10 +1230,13 @@ public function run_cron( $max = 100 ) {
$max = 10;
}
global $post;
$args = array(
'post_type' => 'feedzy_imports',
'post_status' => 'publish',
'numberposts' => 99,
$args = apply_filters(
'feedzy_run_cron_get_posts_args',
array(
'post_type' => 'feedzy_imports',
'post_status' => 'publish',
'numberposts' => 99,
)
);

$feedzy_imports = get_posts( $args );
Expand Down
8 changes: 7 additions & 1 deletion includes/layouts/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,22 @@

$help_btn_url = 'https://docs.themeisle.com/category/712-feedzy';

if ( 'headers' === $active_tab ) {
if ( 'general' === $active_tab ) {
$help_btn_url = 'https://docs.themeisle.com/article/1119-feedzy-rss-feeds-documentation#general';
} elseif ( 'headers' === $active_tab ) {
$help_btn_url = 'https://docs.themeisle.com/article/713-how-to-change-user-agent-in-feedzy';
} elseif ( 'proxy' === $active_tab ) {
$help_btn_url = 'https://docs.themeisle.com/article/714-how-to-use-proxy-settings-in-feezy';
} elseif ( 'misc' === $active_tab ) {
$help_btn_url = 'https://docs.themeisle.com/article/841-how-to-add-canonical-tags-for-imported-posts';
} elseif ( 'openai' === $active_tab ) {
$help_btn_url = 'https://docs.themeisle.com/article/1962-how-to-paraphrase-using-chatgpt-in-feed-to-post';
} elseif ( 'wordai' === $active_tab ) {
$help_btn_url = 'https://docs.themeisle.com/article/746-how-to-use-wordai-to-rephrase-rss-content-in-feedzy#wordai';
} elseif ( 'spinnerchief' === $active_tab ) {
$help_btn_url = 'https://docs.themeisle.com/article/746-how-to-use-wordai-to-rephrase-rss-content-in-feedzy#spinner';
} elseif ( 'amazon-product-advertising' === $active_tab ) {
$help_btn_url = 'https://docs.themeisle.com/article/1745-how-to-display-amazon-products-using-feedzy';
}
?>
<?php if ( $this->notice ) { ?>
Expand Down
2 changes: 1 addition & 1 deletion includes/layouts/setup-wizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
sprintf(
// translators: %1$s and %2$s are HTML tags for the link to the demo URL.
__( 'No Feed URL? %1$s Click here %2$s to use demo URL', 'feedzy-rss-feeds' ),
'<a target="_blank" class="feed-demo-link" href="' . esc_url( 'https://www.codeinwp.com/feed/' ) . '" >',
'<a target="_blank" class="feed-demo-link" href="' . esc_url( 'https://wpshout.com/feed/' ) . '" >',
'</a>'
)
);
Expand Down
8 changes: 4 additions & 4 deletions includes/views/import-metabox-edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class="dashicons dashicons-external"></i></a>
<div class="dropdown">
<button type="button" class="btn btn-outline-primary dropdown-toggle" aria-haspopup="true"
aria-expanded="false">
<?php esc_html_e( 'Use Feed Category', 'feedzy-rss-feeds' ); ?> <span
<?php esc_html_e( 'Use Feed Group', 'feedzy-rss-feeds' ); ?> <span
class="dashicons dashicons-arrow-down-alt2"></span>
</button>
<div class="dropdown-menu dropdown-menu-right">
Expand All @@ -95,8 +95,8 @@ class="dashicons dashicons-arrow-down-alt2"></span>
} else {
?>
<div class="no-data p-8">
<div class="help-text"><?php esc_html_e( 'You don&#8217;t have any categories, yet.', 'feedzy-rss-feeds' ); ?></div>
<div class="cta-text"><a href="<?php echo esc_url( add_query_arg( 'post_type', 'feedzy_categories', admin_url( 'post-new.php' ) ) ); ?>" target="_blank"><?php esc_html_e( 'Add a Category', 'feedzy-rss-feeds' ); ?></a></div>
<div class="help-text"><?php esc_html_e( 'You don&#8217;t have any groups, yet.', 'feedzy-rss-feeds' ); ?></div>
<div class="cta-text"><a href="<?php echo esc_url( add_query_arg( 'post_type', 'feedzy_categories', admin_url( 'post-new.php' ) ) ); ?>" target="_blank"><?php esc_html_e( 'Add a Group', 'feedzy-rss-feeds' ); ?></a></div>
</div>
<?php
}
Expand Down Expand Up @@ -645,7 +645,7 @@ class="fz-switch-toggle" type="checkbox" value="yes"
</div>
<div class="help-text">
<?php
esc_html_e( 'Add magic tags to extract custom elements from your feed. This will work only for single-feeds, not feed categories.', 'feedzy-rss-feeds' );
esc_html_e( 'Add magic tags to extract custom elements from your feed. This will work only for single-feeds, not feed groups.', 'feedzy-rss-feeds' );
?>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions js/FeedzyBlock/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ class Editor extends Component {
<TextControl
type="url"
className="feedzy-source"
placeholder={ __( 'Enter URL or category of your feed here...', 'feedzy-rss-feeds' ) }
placeholder={ __( 'Enter URL or group of your feed here...', 'feedzy-rss-feeds' ) }
onChange={ this.onChangeFeed }
onKeyUp={ this.handleKeyUp }
value={ this.props.attributes.feeds }
Expand Down Expand Up @@ -437,8 +437,8 @@ class Editor extends Component {
),
( this.state.error ) && <div>{ __( 'Feed URL is invalid or unreachable by WordPress SimplePie and will NOT display items.', 'feedzy-rss-feeds') }</div>,
<p>
{ __( 'Enter the full URL of the feed source you wish to display here, or the name of a category you\'ve created. Also you can add multiple URLs just separate them with a comma. You can manage your categories feed from', 'feedzy-rss-feeds') }
<a href="edit.php?post_type=feedzy_categories" title={ __( 'feedzy categories ', 'feedzy-rss-feeds' ) } target="_blank">{ __( 'here ', 'feedzy-rss-feeds' ) }</a>
{ __( 'Enter the full URL of the feed source you wish to display here, or the name of a group you\'ve created. Also you can add multiple URLs just separate them with a comma. You can manage your groups feed from ', 'feedzy-rss-feeds') }
<a href="edit.php?post_type=feedzy_categories" title={ __( 'Feedzy Groups ', 'feedzy-rss-feeds' ) } target="_blank">{ __( 'here ', 'feedzy-rss-feeds' ) }</a>
</p>
] }
</Placeholder>
Expand Down
2 changes: 1 addition & 1 deletion js/Onboarding/import-onboarding.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const Onboarding = () => {
},
{
target: '.fz-input-group-left .fz-input-icon',
content: __( 'Add here your RSS feed URL which Feedzy will use to fetch the content from. You can use Feedzy\'s Feed categories too.', 'feedzy-rss-feeds' ),
content: __( 'Add here your RSS feed URL which Feedzy will use to fetch the content from. You can use Feedzy\'s Feed Groups too.', 'feedzy-rss-feeds' ),
},
{
target: '#fz-import-filters',
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/specs/import.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ test.describe( 'Feed Import', () => {

// Insert a Feedzy block.
await editor.insertBlock({ name: 'feedzy-rss-feeds/feedzy-block' });
await page.getByPlaceholder('Enter URL or category of your').fill(FEED_URL);
await page.getByPlaceholder('Enter URL or group of your').fill(FEED_URL);
await page.getByRole('button', { name: 'Load Feed' }).click();

await page.waitForSelector('.rss_header');
Expand Down

0 comments on commit a2ed420

Please sign in to comment.