Changeset 557228
- Timestamp:
- 06/13/2012 11:45:09 AM (13 years ago)
- Location:
- smtp/trunk
- Files:
-
- 4 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
smtp/trunk/readme.txt
r543285 r557228 1 1 === SMTP === 2 Contributors: hel.io 2 Contributors: hel.io, kley 3 3 Donate link: http://hel.io/donate/ 4 4 Tags: smtp, email, mail, wp_mail, mailer, phpmailer 5 5 Requires at least: 3.0 6 Tested up to: 3.3. 07 Stable tag: 1.1 6 Tested up to: 3.3.2 7 Stable tag: 1.1.2 8 8 9 9 Allows you to configure and use a SMTP server (such as Gmail) for sending emails. … … 47 47 == Changelog == 48 48 49 = 1.0 = 50 * Initial release. 49 = 1.1.2 = 50 * Added support for localization (thanks to [kley](http://wordpress.org/support/profile/klay)) 51 * Added Russian translation (thanks to [kley](http://wordpress.org/support/profile/klay)) 51 52 52 53 = 1.1 = 53 54 * The password field is of type password instead of text and does not display your saved password 54 55 * Now storing encrypted passwords in the database (Make sure you re-enter your password if you are updating) 56 57 = 1.0 = 58 * Initial release. -
smtp/trunk/smtp.php
r544066 r557228 2 2 /* 3 3 Plugin Name: SMTP 4 Version: 1.1. 14 Version: 1.1.2 5 5 Plugin URI: http://hel.io/wordpress/smtp/ 6 6 Description: Allows you to configure and use a SMTP server (such as Gmail) for sending emails. 7 7 Author: Sorin Iclanzan 8 8 Author URI: http://hel.io/ 9 Text Domain: smtp 10 Domain Path: /language 9 11 */ 10 12 11 13 // Key used for encrypting and decrypting passwords 12 14 define( 'CRYPT_KEY', '-J5:2Yqd?Ri9wLjN' ); 15 // Text domain 16 define( 'TEXT_DOMAIN', 'smtp' ); 17 // Plugin basename 18 $plugin_basename = dirname( plugin_basename( __FILE__ ) ); 19 20 // Loads the plugin's translated strings. 21 add_action( 'plugins_loaded', 'smtp_init' ); 22 function smtp_init() { 23 global $plugin_basename; 24 load_plugin_textdomain( TEXT_DOMAIN, false, $plugin_basename . '/language/' ); 25 } 13 26 14 27 // This is run when you activate the plugin, adding the default options to the database 15 28 register_activation_hook(__FILE__,'smtp_activation'); 16 29 function smtp_activation() { 30 global $plugin_basename; 17 31 // Check for compatibility 18 32 try { 19 33 // check mycrypt 20 34 if(!function_exists('mcrypt_encrypt')) { 21 throw new Exception(__('Please enable \'php_mycrypt\' in PHP. It is needed to encrypt passwords.', 'smtp'));35 throw new Exception(__('Please enable \'php_mycrypt\' in PHP. It is needed to encrypt passwords.', TEXT_DOMAIN)); 22 36 } 23 37 } 24 38 catch(Exception $e) { 25 $plugin_basename = dirname(plugin_basename(__FILE__));26 39 deactivate_plugins($plugin_basename.'/backup.php', true); 27 40 echo '<div id="message" class="error">' . $e->getMessage() . '</div>'; … … 46 59 add_action('admin_menu','smtp_menu'); 47 60 function smtp_menu() { 48 add_options_page( 'SMTP Settings', 'SMTP', 'manage_options', 'smtp', 'smtp_options_page');61 add_options_page( __( 'SMTP Settings', TEXT_DOMAIN ), __( 'SMTP', TEXT_DOMAIN ) , 'manage_options', 'smtp', 'smtp_options_page'); 49 62 } 50 63 … … 55 68 return $links; 56 69 57 $settings_link = '<a href="options-general.php?page=smtp">Settings</a>';70 $settings_link = sprintf( '<a href="options-general.php?page=smtp">%s</a>', __( 'Settings', TEXT_DOMAIN ) ); 58 71 59 72 array_unshift( $links, $settings_link ); … … 69 82 70 83 $to = $_POST['to']; 71 $subject = 'SMTP Test';72 $message = 'If you received this email it means you have configured SMTP correctly on your Wordpress website.';84 $subject = __( 'SMTP Test', TEXT_DOMAIN ); 85 $message = __( 'If you received this email it means you have configured SMTP correctly on your Wordpress website.', TEXT_DOMAIN ); 73 86 74 87 // Send the test mail … … 79 92 ?> 80 93 <div id="message" class="updated fade"> 81 <p><strong> Test Email Sent</strong></p>82 <p> The test email was sent successfully!</p>94 <p><strong><?php _e( 'Test Email Sent', TEXT_DOMAIN ); ?></strong></p> 95 <p><?php _e('The test email was sent successfully!', TEXT_DOMAIN ); ?></p> 83 96 </div> 84 97 <?php … … 87 100 ?> 88 101 <div id="message" class="error"> 89 <p><strong> Send Error</strong></p>90 <p> There was an error while trying to send the test email. Please check the connection details.</p>102 <p><strong><?php _e('Send Error', TEXT_DOMAIN ); ?></strong></p> 103 <p><?php _e('There was an error while trying to send the test email. Please check the connection details.', TEXT_DOMAIN ); ?></p> 91 104 </div> 92 105 <?php … … 96 109 ?> 97 110 <div class="wrap"> 98 <h2>SMTP Settings</h2>111 <h2><?php _e('SMTP Settings', TEXT_DOMAIN ); ?></h2> 99 112 100 113 <form action="options.php" method="post"> … … 102 115 <?php do_settings_sections('smtp'); ?> 103 116 <p class="submit"> 104 <input name="submit" type="submit" class="button-primary" value="<?php _e('Save Changes' )?>" />117 <input name="submit" type="submit" class="button-primary" value="<?php _e('Save Changes', TEXT_DOMAIN ); ?>" /> 105 118 </p> 106 119 </form> 107 120 108 <h3> Send a Test Email</h3>109 <p> Enter an email address below to send a test message.</p>121 <h3><?php _e('Send a Test Email', TEXT_DOMAIN ); ?></h3> 122 <p><?php _e('Enter an email address below to send a test message.', TEXT_DOMAIN ); ?></p> 110 123 <form action="options-general.php?page=smtp" method="post"> 111 124 <table class="optiontable form-table"> 112 125 <tr valign="top"> 113 <th scope="row"><label for="to"> To:</label></th>126 <th scope="row"><label for="to"><?php _e('To:', TEXT_DOMAIN ); ?></label></th> 114 127 <td> 115 128 <input name="to" type="text" id="to" value="" class="regular-text" /> … … 118 131 </table> 119 132 <p class="submit"> 120 <input type="submit" name="smtp_test" id="smtp_test" class="button-primary" value=" Send" />133 <input type="submit" name="smtp_test" id="smtp_test" class="button-primary" value="<?php _e('Send', TEXT_DOMAIN ); ?>" /> 121 134 </p> 122 135 </form> … … 130 143 function smtp_admin_init(){ 131 144 register_setting( 'smtp_options', 'smtp_options', 'smtp_options_validate' ); 132 add_settings_section('smtp_main', 'Settings', 'smtp_section', 'smtp');133 add_settings_field('host', 'Host', 'smtp_host', 'smtp', 'smtp_main');134 add_settings_field('encryption', 'Encryption', 'smtp_encryption', 'smtp', 'smtp_main');135 add_settings_field('username', 'Username', 'smtp_username', 'smtp', 'smtp_main');136 add_settings_field('password', 'Password', 'smtp_password', 'smtp', 'smtp_main');145 add_settings_section('smtp_main', __( 'Settings', TEXT_DOMAIN ), 'smtp_section', 'smtp'); 146 add_settings_field('host', __( 'Host', TEXT_DOMAIN ), 'smtp_host', 'smtp', 'smtp_main'); 147 add_settings_field('encryption', __( 'Encryption', TEXT_DOMAIN ), 'smtp_encryption', 'smtp', 'smtp_main'); 148 add_settings_field('username', __( 'Username', TEXT_DOMAIN ), 'smtp_username', 'smtp', 'smtp_main'); 149 add_settings_field('password', __('Password', TEXT_DOMAIN ), 'smtp_password', 'smtp', 'smtp_main'); 137 150 } 138 151 139 152 function smtp_section() { 140 echo '<p> Please enter your SMTP connection details.</p>';153 echo '<p>' . __( 'Please enter your SMTP connection details.', TEXT_DOMAIN ) . '</p>'; 141 154 } 142 155 … … 145 158 echo " 146 159 <input id='host' name='smtp_options[host]' type='text' class='regular-text' value='{$options['host']}' /> 147 <label for='port'> Port</label>160 <label for='port'>" . __( 'Port', TEXT_DOMAIN ) . "</label> 148 161 <input id='port' name='smtp_options[port]' type='text' class='small-text' value='{$options['port']}' /> 149 162 "; … … 153 166 $options = get_option('smtp_options'); 154 167 echo " 155 <label><input name='smtp_options[smtp_secure]' type='radio' class='tog' value='' ". checked('', $options['smtp_secure'], false) . " /> <span> None</span></label><br/>156 <label><input name='smtp_options[smtp_secure]' type='radio' class='tog' value='ssl' " . checked('ssl', $options['smtp_secure'], false) . " /> <span> SSL</span></label><br/>157 <label><input name='smtp_options[smtp_secure]' type='radio' class='tog' value='tls' " . checked('tls', $options['smtp_secure'], false) . " /> <span> TLS</span></label>168 <label><input name='smtp_options[smtp_secure]' type='radio' class='tog' value='' ". checked('', $options['smtp_secure'], false) . " /> <span>" . __( 'None', TEXT_DOMAIN ) . "</span></label><br/> 169 <label><input name='smtp_options[smtp_secure]' type='radio' class='tog' value='ssl' " . checked('ssl', $options['smtp_secure'], false) . " /> <span>" . __( 'SSL', TEXT_DOMAIN ) . "</span></label><br/> 170 <label><input name='smtp_options[smtp_secure]' type='radio' class='tog' value='tls' " . checked('tls', $options['smtp_secure'], false) . " /> <span>" . __( 'TLS', TEXT_DOMAIN ) . "</span></label> 158 171 "; 159 172 }
Note: See TracChangeset
for help on using the changeset viewer.