Advertisement
barzik

Contribution to WP SMTP plugin

May 31st, 2014
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 9.27 KB | None | 0 0
  1. Index: wp_smtp_admin.php
  2. ===================================================================
  3. --- wp_smtp_admin.php   (revision 924247)
  4. +++ wp_smtp_admin.php   (working copy)
  5. @@ -150,12 +150,12 @@
  6.         <td>
  7.             <label>
  8.                 <input name="wp_smtp_smtpauth" type="radio" value="no"<?php if ($wsOptions["smtpauth"] == 'no') { ?> checked="checked"<?php } ?> />
  9. -               No
  10. +                <?php _e('No'); ?>
  11.             </label>
  12.             &nbsp;
  13.             <label>
  14.                 <input name="wp_smtp_smtpauth" type="radio" value="yes"<?php if ($wsOptions["smtpauth"] == 'yes') { ?> checked="checked"<?php } ?> />
  15. -               Yes
  16. +                <?php _e('Yes'); ?>
  17.             </label>
  18.         </td>
  19.     </tr>
  20. Index: lang/wp-smtp-he_IL.mo
  21. ===================================================================
  22. Cannot display: file marked as a binary type.
  23. svn:mime-type = application/octet-stream
  24.  
  25. Property changes on: lang/wp-smtp-he_IL.mo
  26. ___________________________________________________________________
  27. Added: svn:mime-type
  28.    + application/octet-stream
  29.  
  30. Index: lang/wp-smtp-he_IL.po
  31. ===================================================================
  32. --- lang/wp-smtp-he_IL.po   (revision 0)
  33. +++ lang/wp-smtp-he_IL.po   (revision 0)
  34. @@ -0,0 +1,108 @@
  35. +msgid ""
  36. +msgstr ""
  37. +"Project-Id-Version: WP-SMTP Languages\n"
  38. +"Report-Msgid-Bugs-To: \n"
  39. +"POT-Creation-Date: 2013-10-07 00:39+0800\n"
  40. +"PO-Revision-Date: 2014-05-31 17:16+0200\n"
  41. +"Last-Translator: Ran Bar-Zik <ran@bar-zik.com>\n"
  42. +"Language-Team: 玻璃泉BoLiQuan.COM <berttung(#)gmail.com>\n"
  43. +"MIME-Version: 1.0\n"
  44. +"Content-Type: text/plain; charset=UTF-8\n"
  45. +"Content-Transfer-Encoding: 8bit\n"
  46. +"X-Poedit-KeywordsList: __;_e\n"
  47. +"X-Poedit-Basepath: .\n"
  48. +"X-Poedit-SourceCharset: utf-8\n"
  49. +"X-Generator: Poedit 1.6.5\n"
  50. +"Plural-Forms: nplurals=2; plural=(n != 1);\n"
  51. +"Language: he_IL\n"
  52. +"X-Poedit-SearchPath-0: D:\\xampp\\htdocs\\wordpress\\wp-content\\plugins\\wp-"
  53. +"smtp\n"
  54. +
  55. +#: D:\xampp\htdocs\wordpress\wp-content\plugins\wp-smtp/wp-smtp.php:66
  56. +msgid "Settings"
  57. +msgstr "הגדרות"
  58. +
  59. +#: D:\xampp\htdocs\wordpress\wp-content\plugins\wp-smtp/wp_smtp_admin.php:21
  60. +msgid "The field \"From\" must be a valid email address!"
  61. +msgstr "השדה \"מאת\" צריך להיות כתובת דואר אלקטרוני"
  62. +
  63. +#: D:\xampp\htdocs\wordpress\wp-content\plugins\wp-smtp/wp_smtp_admin.php:24
  64. +msgid "The field \"SMTP Host\" can not be left blank!"
  65. +msgstr "השדה \"SMTP Host\" צריך להיות מלא!"
  66. +
  67. +#: D:\xampp\htdocs\wordpress\wp-content\plugins\wp-smtp/wp_smtp_admin.php:27
  68. +msgid "Options saved."
  69. +msgstr "ההגדרות נשמרו."
  70. +
  71. +#: D:\xampp\htdocs\wordpress\wp-content\plugins\wp-smtp/wp_smtp_admin.php:47
  72. +msgid "Message sent!"
  73. +msgstr "ההודעה נשלחה."
  74. +
  75. +#: D:\xampp\htdocs\wordpress\wp-content\plugins\wp-smtp/wp_smtp_admin.php:54
  76. +msgid "Some errors occurred!"
  77. +msgstr "אירעה שגיאה!"
  78. +
  79. +#: D:\xampp\htdocs\wordpress\wp-content\plugins\wp-smtp/wp_smtp_admin.php:57
  80. +msgid ""
  81. +"The fields \"To\" \"Subject\" \"Message\" can not be left blank when testing!"
  82. +msgstr "השדות \"אל\"' \"נושא\" ו\"הודעה\" לא יכולים להיות ריקים במהלך הבדיקה"
  83. +
  84. +#: D:\xampp\htdocs\wordpress\wp-content\plugins\wp-smtp/wp_smtp_admin.php:80
  85. +msgid "From"
  86. +msgstr "מאת"
  87. +
  88. +#: D:\xampp\htdocs\wordpress\wp-content\plugins\wp-smtp/wp_smtp_admin.php:90
  89. +msgid "From Name"
  90. +msgstr "מאת - שם"
  91. +
  92. +#: D:\xampp\htdocs\wordpress\wp-content\plugins\wp-smtp/wp_smtp_admin.php:100
  93. +msgid "SMTP Host"
  94. +msgstr "SMTP Host"
  95. +
  96. +#: D:\xampp\htdocs\wordpress\wp-content\plugins\wp-smtp/wp_smtp_admin.php:110
  97. +msgid "SMTP Secure"
  98. +msgstr "חיבור SMTP מאובטח"
  99. +
  100. +#: D:\xampp\htdocs\wordpress\wp-content\plugins\wp-smtp/wp_smtp_admin.php:131
  101. +msgid "SMTP Port"
  102. +msgstr "SMTP Port"
  103. +
  104. +#: D:\xampp\htdocs\wordpress\wp-content\plugins\wp-smtp/wp_smtp_admin.php:141
  105. +msgid "SMTP Authentication"
  106. +msgstr "ביצוע אימות מול ה-SMTP"
  107. +
  108. +#: D:\xampp\htdocs\wordpress\wp-content\plugins\wp-smtp/wp_smtp_admin.php:157
  109. +msgid "Username"
  110. +msgstr "שם משתמש"
  111. +
  112. +#: D:\xampp\htdocs\wordpress\wp-content\plugins\wp-smtp/wp_smtp_admin.php:167
  113. +msgid "Password"
  114. +msgstr "סיסמה"
  115. +
  116. +#: D:\xampp\htdocs\wordpress\wp-content\plugins\wp-smtp/wp_smtp_admin.php:177
  117. +msgid "Delete Options"
  118. +msgstr "מחיקת ההגדרות"
  119. +
  120. +#: D:\xampp\htdocs\wordpress\wp-content\plugins\wp-smtp/wp_smtp_admin.php:182
  121. +msgid "Delete options while deactivate this plugin."
  122. +msgstr "מחיקת ההגדרות כאשר מפסיקים את פעולת התוסף"
  123. +
  124. +#: D:\xampp\htdocs\wordpress\wp-content\plugins\wp-smtp/wp_smtp_admin.php:190
  125. +msgid "Save Changes"
  126. +msgstr "שמירת שינויים"
  127. +
  128. +#: D:\xampp\htdocs\wordpress\wp-content\plugins\wp-smtp/wp_smtp_admin.php:199
  129. +msgid "To:"
  130. +msgstr "אל:"
  131. +
  132. +#: D:\xampp\htdocs\wordpress\wp-content\plugins\wp-smtp/wp_smtp_admin.php:209
  133. +msgid "Subject:"
  134. +msgstr "נושא:"
  135. +
  136. +#: D:\xampp\htdocs\wordpress\wp-content\plugins\wp-smtp/wp_smtp_admin.php:219
  137. +msgid "Message:"
  138. +msgstr "הודעה:"
  139. +
  140. +#: D:\xampp\htdocs\wordpress\wp-content\plugins\wp-smtp/wp_smtp_admin.php:230
  141. +msgid "Send Test"
  142. +msgstr "שליחת בדיקה"
  143. Index: tests/bootstrap.php
  144. ===================================================================
  145. --- tests/bootstrap.php (revision 0)
  146. +++ tests/bootstrap.php (revision 0)
  147. @@ -0,0 +1,35 @@
  148. +<?php
  149. +/**
  150. + * Bootstrap the plugin unit testing environment.
  151. + *
  152. + * Edit 'active_plugins' setting below to point to your main plugin file.
  153. + *
  154. + * @package wordpress-plugin-tests
  155. + */
  156. +
  157. +// Activates this plugin in WordPress so it can be tested.
  158. +$GLOBALS['wp_tests_options'] = array(
  159. +   'active_plugins' => array( 'wp-smtp/wp-smtp.php' ),
  160. +);
  161. +
  162. +
  163. +
  164. +// If the develop repo location is defined (as WP_DEVELOP_DIR), use that
  165. +// location. Otherwise, we'll just assume that this plugin is installed in a
  166. +// WordPress develop SVN checkout.
  167. +
  168. +if( false !== getenv( 'WP_DEVELOP_DIR' ) ) {
  169. +   require getenv( 'WP_DEVELOP_DIR' ) . '/tests/phpunit/includes/bootstrap.php';
  170. +} else {
  171. +   require '../../../../tests/phpunit/includes/bootstrap.php';
  172. +
  173. +}
  174. +
  175. +$wsOptions = array();
  176. +$wsOptions["from"] = 'smtp-test@test.com';
  177. +$wsOptions["fromname"] = 'testy';
  178. +$wsOptions["host"] = 'smtp-test.test-com';
  179. +$wsOptions["smtpsecure"] = 'no';
  180. +$wsOptions["port"] = '18000';
  181. +$wsOptions["smtpauth"] = 'no';
  182. +update_option("wp_smtp_options",$wsOptions);
  183.  
  184. Property changes on: tests/bootstrap.php
  185. ___________________________________________________________________
  186. Added: svn:executable
  187.    + *
  188.  
  189. Index: tests/test_wp-smtp.php
  190. ===================================================================
  191. --- tests/test_wp-smtp.php  (revision 0)
  192. +++ tests/test_wp-smtp.php  (revision 0)
  193. @@ -0,0 +1,69 @@
  194. +<?php
  195. +
  196. +/**
  197. + * Tests to test that that testing framework is testing tests. Meta, huh?
  198. + *
  199. + * @package wordpress-plugins-tests
  200. + */
  201. +class WP_Test_WordPress_Plugin_Tests extends WP_UnitTestCase {
  202. +
  203. +    public function setUp() {
  204. +        $_SERVER['SERVER_NAME'] = 'example.com';
  205. +    }
  206. +   /**
  207. +    * Run a simple test to ensure that the tests are running
  208. +    */
  209. +    function test_tests() {
  210. +       $this->assertTrue( true );
  211. +    }
  212. +
  213. +   /**
  214. +    * Ensure that the plugin has been installed and activated.
  215. +    */
  216. +   function test_plugin_activated() {
  217. +       $this->assertTrue( is_plugin_active( 'wp-smtp/wp-smtp.php' ) );
  218. +   }
  219. +
  220. +    /*
  221. +     * See that The Mailer is real smtp
  222. +     */
  223. +
  224. +    function test_wp_mailer_smtp() {
  225. +        wp_mail('test-destination@test.com', 'This is test title', 'This is test body');
  226. +        $this->assertEquals($GLOBALS['phpmailer']->Mailer, 'smtp');
  227. +    }
  228. +
  229. +    /* testing secured smtp request */
  230. +
  231. +    function test_wp_mailer_secure_smtp() {
  232. +        global $wsOptions;
  233. +        $wsOptions["smtpsecure"] = 'yes';
  234. +        $wsOptions["smtpauth"] = 'yes';
  235. +        $wsOptions["username"] = 'testy_user';
  236. +        $wsOptions["password"] = 'testy_password';
  237. +        update_option("wp_smtp_options",$wsOptions);
  238. +
  239. +
  240. +        wp_mail('test-destination@test.com', 'This is test title', 'This is test body');
  241. +        $phpmailer = $GLOBALS['phpmailer'];
  242. +
  243. +        $this->assertTrue( $phpmailer->SMTPAuth );
  244. +        $this->assertEquals($phpmailer->Username, 'testy_user');
  245. +        $this->assertEquals($phpmailer->Password, 'testy_password');
  246. +    }
  247. +
  248. +    /*
  249. +     * Test that filter for setting is there
  250. +     */
  251. +
  252. +    function test_wp_smtp_filter() {
  253. +        $result = has_filter('plugin_action_links','wp_smtp_settings_link');
  254. +        $this->assertTrue(is_numeric($result));
  255. +    }
  256. +
  257. +    public function tearDown() {
  258. +        unset($_SERVER['SERVER_NAME']);
  259. +    }
  260. +
  261. +
  262. +}
  263.  
  264. Property changes on: tests/test_wp-smtp.php
  265. ___________________________________________________________________
  266. Added: svn:executable
  267.    + *
  268.  
  269. Index: phpunit.xml
  270. ===================================================================
  271. --- phpunit.xml (revision 0)
  272. +++ phpunit.xml (revision 0)
  273. @@ -0,0 +1,8 @@
  274. +<phpunit bootstrap="tests/bootstrap.php" backupGlobals="false" colors="true">
  275. +    <testsuites>
  276. +        <!-- Default test suite to run all tests -->
  277. +        <testsuite>
  278. +            <directory prefix="test_" suffix=".php">tests</directory>
  279. +        </testsuite>
  280. +    </testsuites>
  281. +</phpunit>
  282. \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement