Skip to content

Commit 5a6cd48

Browse files
authored
Merge pull request #6 from arunbasillal/branch-3.0
Branch 3.0
2 parents 1830399 + 54154d7 commit 5a6cd48

8 files changed

+68
-103
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Automatically Add Image Title, Caption, Description And Alt Text From Filename.
44

55
The plugin can update image attributes for both new images and existing images in the media library.
66

7+
[![Image Attributes Pro Demo Video](https://i.ytimg.com/vi/V5SOU4okOfU/maxresdefault.jpg)](https://youtu.be/V5SOU4okOfU)
8+
79
Image alt text and title is critical for your image SEO and will help users discover your images (and there by your website) in Google / Yahoo / Bing image search.
810

911
Proper alt text also helps people who are blind or who have low vision understand your images there by improving the accessibility of your website. This will open up your website to a new segment of visitors and increase your traffic.

admin/css/iaff-style.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@
5656
color: #DC3232;
5757
}
5858

59+
#iaff-pro p.iaff-description {
60+
color: #646970;
61+
font-weight: 400;
62+
}
63+
5964
#iaff-pro a.nav-tab:focus {
6065
box-shadow: none;
6166
}

admin/iaff_image-attributes-from-filename-admin-setup.php

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,11 @@ function iaff_register_settings() {
5656
'__return_false', // Callback Function
5757
'iaff_basic_settings_section' // Page slug
5858
);
59-
60-
// Global Switch
61-
add_settings_field(
62-
'iaff_global_switch', // ID
63-
__('Global Switch', 'auto-image-attributes-from-filename-with-bulk-updater'), // Title
64-
'iaff_global_switch_callback', // Callback function
65-
'iaff_basic_settings_section', // Page slug
66-
'iaff_basic_settings_section_id' // Settings Section ID
67-
);
6859

6960
// General Settings
7061
add_settings_field(
7162
'iaff_general_settings', // ID
72-
__('General Settings', 'auto-image-attributes-from-filename-with-bulk-updater'), // Title
63+
__( 'General Settings<p class="iaff-description">Select image attributes that should be automatically generated when you upload a new image.</p>', 'auto-image-attributes-from-filename-with-bulk-updater' ), // Title
7364
'iaff_general_settings_callback', // Callback function
7465
'iaff_basic_settings_section', // Page slug
7566
'iaff_basic_settings_section_id' // Settings Section ID
@@ -78,7 +69,7 @@ function iaff_register_settings() {
7869
// Filter Settings
7970
add_settings_field(
8071
'iaff_filter_settings', // ID
81-
__('Filter Settings', 'auto-image-attributes-from-filename-with-bulk-updater'), // Title
72+
__( 'Filter Settings<p class="iaff-description">Selected characters will be removed from filename text before using them as image attributes.</p>', 'auto-image-attributes-from-filename-with-bulk-updater' ), // Title
8273
'iaff_filter_settings_callback', // Callback function
8374
'iaff_basic_settings_section', // Page slug
8475
'iaff_basic_settings_section_id' // Settings Section ID
@@ -116,7 +107,7 @@ function iaff_register_settings() {
116107
// Advanced Filter
117108
add_settings_field(
118109
'iaff_advanced_filter_settings', // ID
119-
__('Advanced Filter', 'auto-image-attributes-from-filename-with-bulk-updater'), // Title
110+
__( 'Advanced Filter<p class="iaff-description">Selected characters will be removed from filename text before using them as image attributes.</p>', 'auto-image-attributes-from-filename-with-bulk-updater' ), // Title
120111
'iaff_advanced_filter_callback', // Callback function
121112
'iaff_advanced_settings_section', // Page slug
122113
'iaff_advanced_settings_section_id' // Settings Section ID
@@ -196,7 +187,7 @@ function iaff_register_settings() {
196187
// General Settings
197188
add_settings_field(
198189
'iaff_bu_general_settings', // ID
199-
__('General Settings', 'auto-image-attributes-from-filename-with-bulk-updater'), // Title
190+
__( 'General Settings<p class="iaff-description">Select image attributes that should be updated when you run the Bulk Updater.</p>', 'auto-image-attributes-from-filename-with-bulk-updater' ), // Title
200191
'iaff_bu_general_settings_callback', // Callback function
201192
'iaff_bu_settings_section', // Page slug
202193
'iaff_bu_settings_section_id' // Settings Section ID
@@ -205,7 +196,7 @@ function iaff_register_settings() {
205196
// Filter Settings
206197
add_settings_field(
207198
'iaff_bu_filter_settings', // ID
208-
__('Filter Settings', 'auto-image-attributes-from-filename-with-bulk-updater'), // Title
199+
__( 'Filter Settings<p class="iaff-description">Selected characters will be removed from filename text before using them as image attributes.</p>', 'auto-image-attributes-from-filename-with-bulk-updater' ), // Title
209200
'iaff_bu_filter_settings_callback', // Callback function
210201
'iaff_bu_settings_section', // Page slug
211202
'iaff_bu_settings_section_id' // Settings Section ID
@@ -315,7 +306,6 @@ function iaff_settings_validater_and_sanitizer( $settings ) {
315306
function iaff_get_settings() {
316307

317308
$iaff_defaults = array(
318-
'global_switch' => '1',
319309
'image_title' => '1',
320310
'image_caption' => '1',
321311
'image_description' => '1',

admin/iaff_image-attributes-from-filename-admin-ui-render.php

Lines changed: 34 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Admin UI setup and render
44
*
55
* @since 1.3
6-
* @function iaff_global_switch_callback() Global Switch Callback
76
* @function iaff_general_settings_callback() General Settings field Callback
87
* @function iaff_filter_settings_callback() Filter Settings field callback
98
* @function iaff_basic_seo_settings_callback() Basic SEO Settings Callback
@@ -30,29 +29,6 @@
3029
// Exit if accessed directly
3130
if ( ! defined('ABSPATH') ) exit;
3231

33-
/**
34-
* Global Switch Callback
35-
*
36-
* @since 1.4
37-
*/
38-
function iaff_global_switch_callback() {
39-
40-
// Get Settings
41-
$settings = iaff_get_settings();
42-
?>
43-
44-
<fieldset>
45-
46-
<label for="iaff_settings[global_switch]">
47-
<input type="checkbox" name="iaff_settings[global_switch]" id="iaff_settings[global_switch]" value="1" <?php if ( isset($settings['global_switch']) ) checked( '1', $settings['global_switch'] ); ?>>
48-
<span><?php _e('Globally enable or disable Auto Image Attributes. Should be checked for the plugin to work.', 'auto-image-attributes-from-filename-with-bulk-updater') ?></span>
49-
</label><br>
50-
51-
</fieldset>
52-
53-
<?php
54-
}
55-
5632
/**
5733
* General Settings field Callback
5834
*
@@ -275,7 +251,7 @@ function iaff_custom_filter_callback() {
275251

276252
<fieldset>
277253

278-
<p><?php _e('Enter words or characters to filter separated by commas. Filter is case sensitive.', 'auto-image-attributes-from-filename-with-bulk-updater') ?></p>
254+
<p><?php printf( __( 'Enter words or characters to filter separated by commas. Filter is case sensitive. <a href="%s" target="_blank">Read more.</a>', 'auto-image-attributes-from-filename-with-bulk-updater' ), 'https://imageattributespro.com/custom-filter-and-regex-filter/?utm_source=iaff-basic&utm_medium=advanced-tab' ); ?></p>
279255
<input type="text" name="iaff_settings[custom_filter]" placeholder="DCIM, img" class="all-options" value="<?php if ( isset( $settings['custom_filter'] ) && ( ! empty( $settings['custom_filter'] ) ) ) echo esc_attr( $settings['custom_filter'] ); ?>"/><br><br>
280256

281257
<p><?php _e('Filter with regular expression', 'auto-image-attributes-from-filename-with-bulk-updater') ?></p>
@@ -657,7 +633,7 @@ function iaff_bu_custom_filter_callback() {
657633

658634
<fieldset>
659635

660-
<p><?php _e('Enter words or characters to filter separated by commas. Filter is case sensitive.', 'auto-image-attributes-from-filename-with-bulk-updater') ?></p>
636+
<p><?php printf( __( 'Enter words or characters to filter separated by commas. Filter is case sensitive. <a href="%s" target="_blank">Read more.</a>', 'auto-image-attributes-from-filename-with-bulk-updater' ), 'https://imageattributespro.com/custom-filter-and-regex-filter/?utm_source=iaff-basic&utm_medium=bu-settings-tab' ); ?></p>
661637
<input type="text" name="iaff_settings[bu_custom_filter]" placeholder="DCIM, img" class="all-options" value="<?php if ( isset( $settings['bu_custom_filter'] ) && ( ! empty( $settings['bu_custom_filter'] ) ) ) echo esc_attr( $settings['bu_custom_filter'] ); ?>"/><br><br>
662638

663639
<p><?php _e('Filter with regular expression', 'auto-image-attributes-from-filename-with-bulk-updater') ?></p>
@@ -1009,7 +985,7 @@ function iaff_admin_interface_render () {
1009985
<!-- Basic Settings -->
1010986
<div id="iaff-basic" class="iaff-settings-tab">
1011987
<h2 class="showh2"><?php _e('Basic Settings', 'auto-image-attributes-from-filename-with-bulk-updater') ?></h2>
1012-
<p><?php _e('Automatically add Image attributes such as Image Title, Image Caption, Description And Alt Text from Image Filename for new uploads', 'auto-image-attributes-from-filename-with-bulk-updater') ?></p>
988+
<p><?php printf( __( 'Automatically add image attributes such as Image Title, Alt Text, Caption and Description from image filename for new uploads. <a href="%s" target="_blank">Take a tour</a>', 'auto-image-attributes-from-filename-with-bulk-updater' ), 'https://imageattributespro.com/demo/?utm_source=iaff-basic&utm_medium=basic-tab' ); ?> 📺</p>
1013989
<?php do_settings_sections( 'iaff_basic_settings_section' ); ?>
1014990
<?php submit_button( __('Save Settings', 'auto-image-attributes-from-filename-with-bulk-updater') ); ?>
1015991
</div>
@@ -1061,7 +1037,7 @@ function iaff_admin_interface_render () {
10611037
<p><strong><?php _e('Use <code>Test Bulk Updater</code> button to update one image at a time and verify the results.', 'auto-image-attributes-from-filename-with-bulk-updater') ?></strong></p>
10621038

10631039
<?php if( ! iaff_is_pro() ) { ?>
1064-
<p><strong><?php printf( __( 'If your image is named <em>a-lot-like_love.jpg</em>, your Image Title, Caption, Description and Alt Text will be: <em>a lot like love</em>. <a href="%s" target="_blank">Upgrade to Pro</a> for more options.', 'auto-image-attributes-from-filename-with-bulk-updater' ), 'https://imageattributespro.com/?utm_source=iaff-basic&utm_medium=bulk-updater-notice' ); ?></strong></p>
1040+
<p><strong><?php printf( __( 'The Bulk Updater will update every attribute. If your image is named <em>a-lot-like_love.jpg</em>, your Image Title, Alt Text, Caption and Description will be: <em>a lot like love</em>. <a href="%s" target="_blank">Upgrade to Pro</a> for more options.', 'auto-image-attributes-from-filename-with-bulk-updater' ), 'https://imageattributespro.com/?utm_source=iaff-basic&utm_medium=bulk-updater-notice' ); ?></strong></p>
10651041
<?php } ?>
10661042

10671043
</div>
@@ -1177,57 +1153,59 @@ function iaff_admin_interface_render () {
11771153
<div class="iaff-upgrade-header">
11781154
<a href="https://imageattributespro.com/?utm_source=iaff-basic&utm_medium=coupon-sidebar" target="_blank">
11791155
<div class="iaff-icon"></div>
1180-
<h1 class="patua"><?php _e('Upgrade to Pro', 'auto-image-attributes-from-filename-with-bulk-updater'); ?></h1>
1156+
<h1 class="patua"><?php _e( 'Unlock Traffic', 'auto-image-attributes-from-filename-with-bulk-updater' ); ?></h1>
11811157
<ul>
1182-
<li><span class="dashicons dashicons-yes"></span><?php _e('Advanced formatting options', 'auto-image-attributes-from-filename-with-bulk-updater'); ?></li>
1183-
<li><span class="dashicons dashicons-yes"></span><?php _e('Use post titles as attributes', 'auto-image-attributes-from-filename-with-bulk-updater'); ?></li>
1184-
<li><span class="dashicons dashicons-yes"></span><?php _e('Fine tune bulk updater settings', 'auto-image-attributes-from-filename-with-bulk-updater'); ?></li>
1158+
<li><span class="dashicons dashicons-yes"></span><?php _e('Get more traffic from Google Images', 'auto-image-attributes-from-filename-with-bulk-updater'); ?></li>
1159+
<li><span class="dashicons dashicons-yes"></span><?php _e('Use post / product title as attributes', 'auto-image-attributes-from-filename-with-bulk-updater'); ?></li>
1160+
<li><span class="dashicons dashicons-yes"></span><?php _e('Preserve existing attributes', 'auto-image-attributes-from-filename-with-bulk-updater'); ?></li>
1161+
<li><span class="dashicons dashicons-yes"></span><?php _e('Update attributes within posts', 'auto-image-attributes-from-filename-with-bulk-updater'); ?></li>
1162+
<li><span class="dashicons dashicons-yes"></span><?php _e('Build custom attributes and fine tune settings', 'auto-image-attributes-from-filename-with-bulk-updater'); ?></li>
11851163
</ul>
1164+
<button class="button" style="width:100%">Upgrade to Pro &rarr; </button>
11861165
</a>
11871166
</div><!-- .iaff-upgrade-header -->
11881167

11891168
<div class="iaff-upgrade-form">
1169+
1170+
<div class="iaff-upgrade-review">
1171+
<div class="iaff-upgrade-review-stars">
1172+
<h3>"<?php _e('Fast &amp; Simple Time Saver', 'auto-image-attributes-from-filename-with-bulk-updater'); ?>"</h3>
1173+
<?php echo str_repeat('<span class="dashicons dashicons-star-filled"></span>', 5); ?>
1174+
</div>
1175+
<div class="iaff-upgrade-review-detail">
1176+
<div class="iaff-upgrade-review-detail-left">
1177+
<img class="iaff-upgrade-review-avatar" src="<?php echo IAFF_IMAGE_ATTRIBUTES_FROM_FILENAME_URL . 'admin/img/checkerboardflyer.jpeg'; ?>" />
1178+
</div>
1179+
<div class="iaff-upgrade-review-detail-right">
1180+
<p>"<?php _e('This plugin will save me a LOT of time! Great plugin!', 'auto-image-attributes-from-filename-with-bulk-updater'); ?>" <br><a target="_blank" href="https://wordpress.org/support/topic/fast-simple-time-saver/">@checkerboardflyer</a></p>
1181+
</div>
1182+
</div>
1183+
</div>
1184+
1185+
<hr style="margin: 20px 0px;">
11901186

1191-
<form method="post" action="https://imageattributespro.com/coupons/" target="_blank">
1187+
<form method="post" action="https://imageattributespro.com/newsletter/" target="_blank">
11921188

1193-
<h1 class="patua"><?php _e('10&percnt; For Lifetime', 'auto-image-attributes-from-filename-with-bulk-updater'); ?></h1>
1189+
<h1 class="patua" style="text-align: center;"><?php _e( 'SEO Newsletter', 'auto-image-attributes-from-filename-with-bulk-updater' ); ?></h1>
11941190

11951191
<?php $user = wp_get_current_user(); ?>
11961192

1197-
<p><?php _e('Submit your name and email to receive 10&percnt; off when you upgrade to the Lifetime license.', 'auto-image-attributes-from-filename-with-bulk-updater'); ?></p>
1193+
<p><?php _e('Stay tuned to the latest image SEO news and receive helpful product updates.', 'auto-image-attributes-from-filename-with-bulk-updater'); ?></p>
11981194

11991195
<fieldset>
1200-
1201-
<input type="text" name="first_name" value="<?php echo esc_attr( trim( $user->first_name ) ); ?>" placeholder="<?php _e('First Name', 'auto-image-attributes-from-filename-with-bulk-updater'); ?>"/>
1202-
1196+
12031197
<input type="email" name="email" value="<?php echo esc_attr( $user->user_email ); ?>" placeholder="<?php _e('Your Email', 'auto-image-attributes-from-filename-with-bulk-updater'); ?>"/>
12041198

12051199
<input type="hidden" name="source" value="IAFF" />
12061200
<input type="hidden" name="submitted" id="submitted" value="true" />
12071201

1208-
<input type="submit" class="button" value="<?php _e('Send me the coupon', 'auto-image-attributes-from-filename-with-bulk-updater'); ?>"/>
1202+
<input type="submit" class="button-primary" style="margin-top:5px;" value="<?php _e( 'Subscribe', 'auto-image-attributes-from-filename-with-bulk-updater' ); ?>"/>
12091203

12101204
</fieldset>
12111205

12121206
<p class="opacity-75"><?php _e('Your email will be kept private and will not be shared or spammed.', 'auto-image-attributes-from-filename-with-bulk-updater'); ?></p>
1213-
</form>
1214-
1215-
<hr>
1207+
</form>
12161208

1217-
<div class="iaff-upgrade-review">
1218-
<div class="iaff-upgrade-review-stars">
1219-
<h3>"<?php _e('Fast &amp; Simple Time Saver', 'auto-image-attributes-from-filename-with-bulk-updater'); ?>"</h3>
1220-
<?php echo str_repeat('<span class="dashicons dashicons-star-filled"></span>', 5); ?>
1221-
</div>
1222-
<div class="iaff-upgrade-review-detail">
1223-
<div class="iaff-upgrade-review-detail-left">
1224-
<img class="iaff-upgrade-review-avatar" src="<?php echo IAFF_IMAGE_ATTRIBUTES_FROM_FILENAME_URL . 'admin/img/checkerboardflyer.jpeg'; ?>" />
1225-
</div>
1226-
<div class="iaff-upgrade-review-detail-right">
1227-
<p>"<?php _e('This plugin will save me a LOT of time! Great plugin!', 'auto-image-attributes-from-filename-with-bulk-updater'); ?>" <br><a target="_blank" href="https://wordpress.org/support/topic/fast-simple-time-saver/">@checkerboardflyer</a></p>
1228-
</div>
1229-
</div>
1230-
</div>
12311209
</div><!-- .iaff-upgrade-form -->
12321210
</div><!-- .iaff-admin-options-sidebar -->
12331211
<?php } ?>

admin/iaff_image-attributes-from-filename-basic-setup.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,7 @@ function iaff_admin_notices() {
9999
// Upgrade complete notice
100100
if ( get_transient( 'iaff_upgrade_complete_admin_notice' ) ) {
101101

102-
$iaff_suggest_pro = '';
103-
104-
// Suggest IAFF Pro if Pro add-on isn't installed.
105-
if ( ! iaff_is_pro() ) {
106-
$iaff_suggest_pro = sprintf( __( '<br>Want to use Post Titles for image attributes? Check out the <a href="%s" target="_blank">Image Attributes Pro</a> add-on.', 'auto-image-attributes-from-filename-with-bulk-updater' ), 'https://imageattributespro.com/?utm_source=iaff-basic&utm_medium=upgrade-complete-admin-notice' );
107-
}
108-
109-
echo '<div class="notice notice-success is-dismissible"><p>' . __( '<strong>Auto Image Attributes From Filename With Bulk Updater</strong> successfully updated. ', 'auto-image-attributes-from-filename-with-bulk-updater' ) . $iaff_suggest_pro . '</p></div>';
102+
echo '<div class="notice notice-success is-dismissible"><p>' . __( '<strong>Auto Image Attributes From Filename With Bulk Updater</strong> successfully updated. ', 'auto-image-attributes-from-filename-with-bulk-updater' ) . sprintf( __( '<br>Stay tuned to the latest image SEO news and receive helpful product updates. Subscribe to the <a href="%s" target="_blank">Image SEO Newsletter &rarr;</a>', 'auto-image-attributes-from-filename-with-bulk-updater' ), 'https://imageattributespro.com/newsletter/?utm_source=iaff-basic&utm_medium=upgrade-complete-admin-notice' ) . '</p></div>';
110103

111104
// Delete transient
112105
delete_transient( 'iaff_upgrade_complete_admin_notice' );

admin/iaff_image-attributes-from-filename-do.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ function iaff_auto_image_attributes( $post_id ) {
3636
// Return if attachment is not an image
3737
if( ! wp_attachment_is_image($post_id) )
3838
return;
39-
40-
// Return if Global switch is turned off
41-
if ( ! ( isset( $settings['global_switch'] ) && boolval($settings['global_switch']) ) )
42-
return;
4339

4440
// Retrieve image object from its ID
4541
$image = get_post( $post_id );

iaff_image-attributes-from-filename.php

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Description: Automatically Add Image Title, Image Caption, Description And Alt Text From Image Filename. Since this plugin includes a bulk updater this can update both existing images in the Media Library and new images.
66
* Author: Arun Basil Lal
77
* Author URI: https://imageattributespro.com/?utm_source=plugin-header&utm_medium=author-uri
8-
* Version: 2.1
8+
* Version: 3.0
99
* Text Domain: auto-image-attributes-from-filename-with-bulk-updater
1010
* Domain Path: /languages
1111
* License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
@@ -67,7 +67,7 @@
6767
* @since 1.3
6868
*/
6969
if ( ! defined( 'IAFF_VERSION_NUM' ) ) {
70-
define( 'IAFF_VERSION_NUM', '2.1' );
70+
define( 'IAFF_VERSION_NUM', '3.0' );
7171
}
7272

7373
/**
@@ -104,21 +104,6 @@ function iaff_upgrader() {
104104
}
105105
}
106106

107-
/**
108-
* Upgrade database settings when upgrading from 1.3 or lower
109-
* A global swith with setting name global_switch was introduce in 1.4
110-
*/
111-
if ( version_compare( $current_ver, '1.3', '<=' ) ) {
112-
113-
$settings = get_option( 'iaff_settings' );
114-
115-
if ( $settings !== false ) {
116-
117-
$settings['global_switch'] = 1; // Global switch was introduced in ver 1.4
118-
update_option('iaff_settings', $settings);
119-
}
120-
}
121-
122107
/**
123108
* Detect first install.
124109
*

0 commit comments

Comments
 (0)