Plugin Directory

Changeset 2485930


Ignore:
Timestamp:
03/03/2021 04:15:32 PM (5 years ago)
Author:
sendsmaily
Message:

Release 3.0.0, see readme.txt for the changelog.

Location:
smaily-for-wp
Files:
58 added
14 deleted
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • smaily-for-wp/tags/3.0.0/lang/smaily-for-wp-et.po

    r2451736 r2485930  
    22msgstr ""
    33"Project-Id-Version: Smaily for WP\n"
    4 "POT-Creation-Date: 2021-01-06 12:29+0200\n"
    5 "PO-Revision-Date: 2021-01-06 14:09+0200\n"
     4"POT-Creation-Date: 2021-02-18 11:58+0200\n"
     5"PO-Revision-Date: 2021-02-18 12:01+0200\n"
    66"Last-Translator: Smaily <[email protected]>\n"
    77"Language-Team: Smaily <[email protected]>\n"
     
    1818"X-Poedit-SearchPath-0: .\n"
    1919
    20 #: action.php:54
     20#: admin/class-smaily-for-wp-admin.php:190
    2121msgid "Please enter subdomain!"
    2222msgstr "Palun sisesta alamdomeen!"
    2323
    24 #: action.php:62
     24#: admin/class-smaily-for-wp-admin.php:194
    2525msgid "Please enter username!"
    2626msgstr "Palun sisesta kasutajatunnus!"
    2727
    28 #: action.php:70
     28#: admin/class-smaily-for-wp-admin.php:198
    2929msgid "Please enter password!"
    3030msgstr "Palun sisesta parool!"
    3131
    32 #: action.php:90
     32#: admin/class-smaily-for-wp-admin.php:214
    3333msgid "Wrong credentials"
    3434msgstr "Valed autentimise tunnused"
    3535
    36 #: action.php:97
     36#: admin/class-smaily-for-wp-admin.php:219
    3737msgid "Error in subdomain"
    3838msgstr "Viga alamdomeenis"
    3939
    40 #: action.php:111
     40#: admin/class-smaily-for-wp-admin.php:229
    4141msgid "Something went wrong with request to Smaily"
    4242msgstr "Ilmnes probleem Smaily-ga ühendamisel"
    4343
    44 #: action.php:146
     44#: admin/class-smaily-for-wp-admin.php:238
    4545msgid "Credentials validated."
    4646msgstr "Autentimise tunnused valideeritud."
    4747
    48 #: action.php:163
     48#: admin/class-smaily-for-wp-admin.php:255
    4949msgid "Credentials removed."
    5050msgstr "Autentimise tunnused eemaldatud."
    5151
    52 #: action.php:182
     52#: admin/class-smaily-for-wp-admin.php:272
    5353msgid "Newsletter subscription form reset to default."
    5454msgstr "Liitumisvormi kood taasloodud."
    5555
    56 #: action.php:208
    57 msgid "Could not find any autoresponders!"
    58 msgstr "Ei leidnud Automaatvastajaid!"
    59 
    60 #: action.php:232
    61 msgid "Autoresponders refreshed."
    62 msgstr "Automaatvastajad uuendatud."
    63 
    64 #: action.php:276
     56#: admin/class-smaily-for-wp-admin.php:312
    6557msgid "Changes saved."
    6658msgstr "Salvestatud."
    6759
    68 #: html/admin/html/form.php:13
     60#: admin/partials/smaily-for-wp-admin-form.php:8
    6961msgid "Your API credentials are valid"
    7062msgstr "Kasutajatunnused valideeritud"
    7163
    72 #: html/admin/html/form.php:14
     64#: admin/partials/smaily-for-wp-admin-form.php:9
    7365msgid "Remove"
    7466msgstr "Eemalda"
    7567
    76 #: html/admin/html/form.php:21
     68#: admin/partials/smaily-for-wp-admin-form.php:16
    7769msgid "Subdomain"
    7870msgstr "Alamdomeen"
    7971
    80 #: html/admin/html/form.php:31
     72#: admin/partials/smaily-for-wp-admin-form.php:26
    8173msgid "API username"
    8274msgstr "API kasutajatunnus"
    8375
    84 #: html/admin/html/form.php:35
     76#: admin/partials/smaily-for-wp-admin-form.php:30
    8577msgid "API password"
    8678msgstr "API salasõna"
    8779
    88 #: html/admin/html/form.php:40
     80#: admin/partials/smaily-for-wp-admin-form.php:35
    8981msgid "How to create API credentials?"
    9082msgstr "Kuidas luua API kasutaja?"
    9183
    92 #: html/admin/html/form.php:47
     84#: admin/partials/smaily-for-wp-admin-form.php:42
    9385msgid "Check"
    9486msgstr "Kontrolli"
    9587
    96 #: html/admin/html/form.php:53
     88#: admin/partials/smaily-for-wp-admin-form.php:48
    9789msgid "Basic"
    9890msgstr "Tavaseaded"
    9991
    100 #: html/admin/html/form.php:54
     92#: admin/partials/smaily-for-wp-admin-form.php:49
    10193msgid "Advanced"
    10294msgstr "Spetsialisti seaded"
    10395
    104 #: html/admin/html/form.php:60
    105 msgid "Autoresponders"
    106 msgstr "Automaatvastajad"
    107 
    108 #: html/admin/html/form.php:60
    109 msgid "Refresh"
    110 msgstr "Uuenda"
    111 
    112 #: html/admin/html/form.php:61
    113 msgid "Select autoresponder to change regular opt-in functionality"
    114 msgstr "Vali automaatika, et muuta tavalist opt-in funktsionaalsust"
    115 
    116 #: html/admin/html/form.php:64
    117 msgid "No autoresponder"
    118 msgstr "Ilma automaatvastajata vorm"
    119 
    120 #: html/admin/html/form.php:70
    121 msgid "No autoresponders. Please click on refresh link to update."
    122 msgstr "Automaatvastajad puuduvad. Uuendamiseks vajutage värskenda viidet."
    123 
    124 #: html/admin/html/form.php:77
     96#: admin/partials/smaily-for-wp-admin-form.php:55
    12597msgid "Newsletter subscription form"
    12698msgstr "Uudiskirja liitumisvorm"
    12799
    128 #: html/admin/html/form.php:77
     100#: admin/partials/smaily-for-wp-admin-form.php:55
    129101msgid "Restore original subscription form"
    130102msgstr "Taasta algne liitumisvorm"
    131103
    132 #: html/admin/html/form.php:77
     104#: admin/partials/smaily-for-wp-admin-form.php:55
    133105msgid "Regenerate"
    134106msgstr "Taastekita"
    135107
    136 #: html/admin/html/form.php:78
     108#: admin/partials/smaily-for-wp-admin-form.php:56
    137109msgid "HTML of subscription form"
    138110msgstr "Liitumisvormi HTML"
    139111
    140 #: html/admin/html/form.php:83
     112#: admin/partials/smaily-for-wp-admin-form.php:61
    141113msgid "Note: When you save under Basic tab, default form will be used."
    142114msgstr ""
    143115"Hoiatus: Kui salvestad Tavaseadete vaates, kasutatakse lehel vaikimisi vormi."
    144116
    145 #: html/admin/html/form.php:86
     117#: admin/partials/smaily-for-wp-admin-form.php:64
    146118msgid "Save changes"
    147119msgstr "Salvesta muudatused"
    148120
    149 #: html/admin/page.php:26
    150 msgid "Smaily Wordpress plugin"
    151 msgstr "Smaily Wordpressi pistikmoodul"
    152 
    153 #: html/admin/page.php:27
     121#: admin/partials/smaily-for-wp-admin-page.php:3
     122msgid "Smaily WordPress plugin"
     123msgstr "Smaily WordPressi pistikmoodul"
     124
     125#: admin/partials/smaily-for-wp-admin-page.php:4
    154126msgid "Please wait, working..."
    155127msgstr "Palun oota..."
    156128
    157 #: html/form/advanced.php:9 html/form/basic.php:3
    158 msgid "Thank you for subscribing to our newsletter."
    159 msgstr "Täname, et liitusite meie uudiskirjaga."
    160 
    161 #: html/form/advanced.php:16 html/form/basic.php:10
    162 msgid "Email"
    163 msgstr "E-post"
    164 
    165 #: html/form/advanced.php:18 html/form/basic.php:12
    166 msgid "Name"
    167 msgstr "Nimi"
    168 
    169 #: html/form/advanced.php:20 html/form/basic.php:14
    170 msgid "Subscribe"
    171 msgstr "Liitu"
    172 
    173 #: includes/subscribe-widget.php:18
     129#: includes/class-smaily-for-wp-widget.php:37
    174130msgid "Smaily newsletter subscription form"
    175131msgstr "Smaily uudiskirjaga liitumise vorm"
    176132
    177 #: includes/subscribe-widget.php:19
     133#: includes/class-smaily-for-wp-widget.php:38
    178134msgid "Smaily Newsletter Subscription"
    179135msgstr "Smaily uudiskirjaga liitumine"
    180136
    181 #: includes/subscribe-widget.php:63 smaily-for-wp.php:132
     137#: includes/class-smaily-for-wp-widget.php:89
     138#: public/class-smaily-for-wp-public.php:104
    182139msgid "Smaily credentials not validated. Subscription form will not work!"
    183140msgstr "Smaily kasutajatunnused on valideerimata.  Uudiskirja vorm ei tööta!"
    184141
    185 #: includes/subscribe-widget.php:70 smaily-for-wp.php:139
     142#: includes/class-smaily-for-wp-widget.php:96
     143#: public/class-smaily-for-wp-public.php:111
    186144msgid "Form was not submitted using POST method."
    187145msgstr "Andmeid peab saatma POST tegevusviisiga."
    188146
    189 #: includes/subscribe-widget.php:73 smaily-for-wp.php:142
     147#: includes/class-smaily-for-wp-widget.php:99
     148#: public/class-smaily-for-wp-public.php:114
    190149msgid "Input does not contain a recognizable email address."
    191150msgstr "Sisend ei sisalda tuntavat emaili aadressi."
    192151
    193 #: includes/subscribe-widget.php:76 smaily-for-wp.php:145
     152#: includes/class-smaily-for-wp-widget.php:102
     153#: public/class-smaily-for-wp-public.php:117
    194154msgid ""
    195155"Could not add to subscriber list for an unknown reason. Probably something "
     
    199159"probleem Smaily-s."
    200160
    201 #: includes/subscribe-widget.php:129
     161#: includes/class-smaily-for-wp-widget.php:166
    202162msgid "Title"
    203163msgstr "Pealkiri"
    204164
    205 #: includes/subscribe-widget.php:139
     165#: includes/class-smaily-for-wp-widget.php:176
    206166msgid "Display name field?"
    207167msgstr "Näita nime välja?"
    208168
    209 #: includes/subscribe-widget.php:146
     169#: includes/class-smaily-for-wp-widget.php:183
    210170msgid "Success URL"
    211171msgstr "Õnnestumise URL"
    212172
    213 #: includes/subscribe-widget.php:154
     173#: includes/class-smaily-for-wp-widget.php:191
    214174msgid "Failure URL"
    215175msgstr "Ebaõnnestumise URL"
     176
     177#: includes/class-smaily-for-wp-widget.php:199
     178msgid "Autoresponders"
     179msgstr "Automaatvastajad"
     180
     181#: includes/class-smaily-for-wp-widget.php:201
     182msgid "No autoresponder"
     183msgstr "Ilma automaatvastajata vorm"
     184
     185#: public/partials/smaily-for-wp-public-advanced.php:9
     186#: public/partials/smaily-for-wp-public-basic.php:3
     187msgid "Thank you for subscribing to our newsletter."
     188msgstr "Täname, et liitusite meie uudiskirjaga."
     189
     190#: public/partials/smaily-for-wp-public-advanced.php:16
     191#: public/partials/smaily-for-wp-public-basic.php:10
     192msgid "Email"
     193msgstr "E-post"
     194
     195#: public/partials/smaily-for-wp-public-advanced.php:18
     196#: public/partials/smaily-for-wp-public-basic.php:12
     197msgid "Name"
     198msgstr "Nimi"
     199
     200#: public/partials/smaily-for-wp-public-advanced.php:20
     201#: public/partials/smaily-for-wp-public-basic.php:14
     202msgid "Subscribe"
     203msgstr "Liitu"
  • smaily-for-wp/tags/3.0.0/lang/smaily-for-wp.pot

    r2451736 r2485930  
    33msgstr ""
    44"Project-Id-Version: Smaily for WP\n"
    5 "POT-Creation-Date: 2021-01-06 14:06+0200\n"
     5"POT-Creation-Date: 2021-02-18 12:00+0200\n"
    66"PO-Revision-Date: 2021-01-05 20:12+0200\n"
    77"Last-Translator: Smaily <[email protected]>\n"
     
    1919"X-Poedit-SearchPath-0: .\n"
    2020
    21 #: action.php:54
     21#: admin/class-smaily-for-wp-admin.php:190
    2222msgid "Please enter subdomain!"
    2323msgstr ""
    2424
    25 #: action.php:62
     25#: admin/class-smaily-for-wp-admin.php:194
    2626msgid "Please enter username!"
    2727msgstr ""
    2828
    29 #: action.php:70
     29#: admin/class-smaily-for-wp-admin.php:198
    3030msgid "Please enter password!"
    3131msgstr ""
    3232
    33 #: action.php:90
     33#: admin/class-smaily-for-wp-admin.php:214
    3434msgid "Wrong credentials"
    3535msgstr ""
    3636
    37 #: action.php:97
     37#: admin/class-smaily-for-wp-admin.php:219
    3838msgid "Error in subdomain"
    3939msgstr ""
    4040
    41 #: action.php:111
     41#: admin/class-smaily-for-wp-admin.php:229
    4242msgid "Something went wrong with request to Smaily"
    4343msgstr ""
    4444
    45 #: action.php:146
     45#: admin/class-smaily-for-wp-admin.php:238
    4646msgid "Credentials validated."
    4747msgstr ""
    4848
    49 #: action.php:163
     49#: admin/class-smaily-for-wp-admin.php:255
    5050msgid "Credentials removed."
    5151msgstr ""
    5252
    53 #: action.php:182
     53#: admin/class-smaily-for-wp-admin.php:272
    5454msgid "Newsletter subscription form reset to default."
    5555msgstr ""
    5656
    57 #: action.php:208
    58 msgid "Could not find any autoresponders!"
    59 msgstr ""
    60 
    61 #: action.php:232
    62 msgid "Autoresponders refreshed."
    63 msgstr ""
    64 
    65 #: action.php:276
     57#: admin/class-smaily-for-wp-admin.php:312
    6658msgid "Changes saved."
    6759msgstr ""
    6860
    69 #: html/admin/html/form.php:13
     61#: admin/partials/smaily-for-wp-admin-form.php:8
    7062msgid "Your API credentials are valid"
    7163msgstr ""
    7264
    73 #: html/admin/html/form.php:14
     65#: admin/partials/smaily-for-wp-admin-form.php:9
    7466msgid "Remove"
    7567msgstr ""
    7668
    77 #: html/admin/html/form.php:21
     69#: admin/partials/smaily-for-wp-admin-form.php:16
    7870msgid "Subdomain"
    7971msgstr ""
    8072
    81 #: html/admin/html/form.php:31
     73#: admin/partials/smaily-for-wp-admin-form.php:26
    8274msgid "API username"
    8375msgstr ""
    8476
    85 #: html/admin/html/form.php:35
     77#: admin/partials/smaily-for-wp-admin-form.php:30
    8678msgid "API password"
    8779msgstr ""
    8880
    89 #: html/admin/html/form.php:40
     81#: admin/partials/smaily-for-wp-admin-form.php:35
    9082msgid "How to create API credentials?"
    9183msgstr ""
    9284
    93 #: html/admin/html/form.php:47
     85#: admin/partials/smaily-for-wp-admin-form.php:42
    9486msgid "Check"
    9587msgstr ""
    9688
    97 #: html/admin/html/form.php:53
     89#: admin/partials/smaily-for-wp-admin-form.php:48
    9890msgid "Basic"
    9991msgstr ""
    10092
    101 #: html/admin/html/form.php:54
     93#: admin/partials/smaily-for-wp-admin-form.php:49
    10294msgid "Advanced"
    10395msgstr ""
    10496
    105 #: html/admin/html/form.php:60
    106 msgid "Autoresponders"
    107 msgstr ""
    108 
    109 #: html/admin/html/form.php:60
    110 msgid "Refresh"
    111 msgstr ""
    112 
    113 #: html/admin/html/form.php:61
    114 msgid "Select autoresponder to change regular opt-in functionality"
    115 msgstr ""
    116 
    117 #: html/admin/html/form.php:64
    118 msgid "No autoresponder"
    119 msgstr ""
    120 
    121 #: html/admin/html/form.php:70
    122 msgid "No autoresponders. Please click on refresh link to update."
    123 msgstr ""
    124 
    125 #: html/admin/html/form.php:77
     97#: admin/partials/smaily-for-wp-admin-form.php:55
    12698msgid "Newsletter subscription form"
    12799msgstr ""
    128100
    129 #: html/admin/html/form.php:77
     101#: admin/partials/smaily-for-wp-admin-form.php:55
    130102msgid "Restore original subscription form"
    131103msgstr ""
    132104
    133 #: html/admin/html/form.php:77
     105#: admin/partials/smaily-for-wp-admin-form.php:55
    134106msgid "Regenerate"
    135107msgstr ""
    136108
    137 #: html/admin/html/form.php:78
     109#: admin/partials/smaily-for-wp-admin-form.php:56
    138110msgid "HTML of subscription form"
    139111msgstr ""
    140112
    141 #: html/admin/html/form.php:83
     113#: admin/partials/smaily-for-wp-admin-form.php:61
    142114msgid "Note: When you save under Basic tab, default form will be used."
    143115msgstr ""
    144116
    145 #: html/admin/html/form.php:86
     117#: admin/partials/smaily-for-wp-admin-form.php:64
    146118msgid "Save changes"
    147119msgstr ""
    148120
    149 #: html/admin/page.php:26
    150 msgid "Smaily Wordpress plugin"
    151 msgstr ""
    152 
    153 #: html/admin/page.php:27
     121#: admin/partials/smaily-for-wp-admin-page.php:3
     122msgid "Smaily WordPress plugin"
     123msgstr ""
     124
     125#: admin/partials/smaily-for-wp-admin-page.php:4
    154126msgid "Please wait, working..."
    155127msgstr ""
    156128
    157 #: html/form/advanced.php:9 html/form/basic.php:3
    158 msgid "Thank you for subscribing to our newsletter."
    159 msgstr ""
    160 
    161 #: html/form/advanced.php:16 html/form/basic.php:10
    162 msgid "Email"
    163 msgstr ""
    164 
    165 #: html/form/advanced.php:18 html/form/basic.php:12
    166 msgid "Name"
    167 msgstr ""
    168 
    169 #: html/form/advanced.php:20 html/form/basic.php:14
    170 msgid "Subscribe"
    171 msgstr ""
    172 
    173 #: includes/subscribe-widget.php:18
     129#: includes/class-smaily-for-wp-widget.php:37
    174130msgid "Smaily newsletter subscription form"
    175131msgstr ""
    176132
    177 #: includes/subscribe-widget.php:19
     133#: includes/class-smaily-for-wp-widget.php:38
    178134msgid "Smaily Newsletter Subscription"
    179135msgstr ""
    180136
    181 #: includes/subscribe-widget.php:63 smaily-for-wp.php:132
     137#: includes/class-smaily-for-wp-widget.php:89
     138#: public/class-smaily-for-wp-public.php:104
    182139msgid "Smaily credentials not validated. Subscription form will not work!"
    183140msgstr ""
    184141
    185 #: includes/subscribe-widget.php:70 smaily-for-wp.php:139
     142#: includes/class-smaily-for-wp-widget.php:96
     143#: public/class-smaily-for-wp-public.php:111
    186144msgid "Form was not submitted using POST method."
    187145msgstr ""
    188146
    189 #: includes/subscribe-widget.php:73 smaily-for-wp.php:142
     147#: includes/class-smaily-for-wp-widget.php:99
     148#: public/class-smaily-for-wp-public.php:114
    190149msgid "Input does not contain a recognizable email address."
    191150msgstr ""
    192151
    193 #: includes/subscribe-widget.php:76 smaily-for-wp.php:145
     152#: includes/class-smaily-for-wp-widget.php:102
     153#: public/class-smaily-for-wp-public.php:117
    194154msgid ""
    195155"Could not add to subscriber list for an unknown reason. Probably something "
     
    197157msgstr ""
    198158
    199 #: includes/subscribe-widget.php:129
     159#: includes/class-smaily-for-wp-widget.php:166
    200160msgid "Title"
    201161msgstr ""
    202162
    203 #: includes/subscribe-widget.php:139
     163#: includes/class-smaily-for-wp-widget.php:176
    204164msgid "Display name field?"
    205165msgstr ""
    206166
    207 #: includes/subscribe-widget.php:146
     167#: includes/class-smaily-for-wp-widget.php:183
    208168msgid "Success URL"
    209169msgstr ""
    210170
    211 #: includes/subscribe-widget.php:154
     171#: includes/class-smaily-for-wp-widget.php:191
    212172msgid "Failure URL"
    213173msgstr ""
     174
     175#: includes/class-smaily-for-wp-widget.php:199
     176msgid "Autoresponders"
     177msgstr ""
     178
     179#: includes/class-smaily-for-wp-widget.php:201
     180msgid "No autoresponder"
     181msgstr ""
     182
     183#: public/partials/smaily-for-wp-public-advanced.php:9
     184#: public/partials/smaily-for-wp-public-basic.php:3
     185msgid "Thank you for subscribing to our newsletter."
     186msgstr ""
     187
     188#: public/partials/smaily-for-wp-public-advanced.php:16
     189#: public/partials/smaily-for-wp-public-basic.php:10
     190msgid "Email"
     191msgstr ""
     192
     193#: public/partials/smaily-for-wp-public-advanced.php:18
     194#: public/partials/smaily-for-wp-public-basic.php:12
     195msgid "Name"
     196msgstr ""
     197
     198#: public/partials/smaily-for-wp-public-advanced.php:20
     199#: public/partials/smaily-for-wp-public-basic.php:14
     200msgid "Subscribe"
     201msgstr ""
  • smaily-for-wp/tags/3.0.0/readme.txt

    r2451736 r2485930  
    44Requires PHP: 5.6
    55Requires at least: 4.0
    6 Stable tag: 2.3.0
     6Stable tag: 3.0.0
    77Tags: widget, plugin, sidebar, api, mail, email, marketing, smaily
    88Tested up to: 5.6.0
     
    7676== Changelog ==
    7777
     78= 3.0.0 =
     79- Autoresponders can be now be configured in widget settings and per widget.
     80- Fix spelling of plugin's admin page title.
     81- Plugin migrations are now automatically executed when plugin is updated.
     82
    7883= 2.3.0 =
    7984- Restructured plugin localizations (see upgrade notice section)
     
    107112== Upgrade Notice ==
    108113
     114= 3.0.0 =
     115
     116Since version 3.0.0, autoresponders can be configured in widget settings.
     117
    109118= 2.3.0 =
    110119
  • smaily-for-wp/tags/3.0.0/smaily-for-wp.php

    r2451736 r2485930  
    1010 * Text Domain:       smaily-for-wp
    1111 * Description:       Smaily newsletter subscription form.
    12  * Version:           2.3.0
     12 * Version:           3.0.0
    1313 * Author:            Sendsmaily LLC
    1414 * Author URI:        https://smaily.com
     
    1717 */
    1818
    19 // Exit if accessed directly.
    20 if ( ! defined( 'ABSPATH' ) ) exit;
     19// If this file is called directly, abort.
     20if ( ! defined( 'ABSPATH' ) ) {
     21    die;
     22}
    2123
    22 define( 'SMLY4WP_PLUGIN_VERSION', '2.3.0' );
    23 // Absolute URL to the plugin, for HTML markup.
     24/**
     25 * Current plugin version.
     26 */
     27define( 'SMLY4WP_PLUGIN_VERSION', '3.0.0' );
     28
     29/**
     30 * Absolute URL to the Smaily for WP plugin directory.
     31 */
    2432define( 'SMLY4WP_PLUGIN_URL', plugins_url( '', __FILE__ ) );
     33
     34/**
     35 * Absolute path to the Smaily for WP plugin directory.
     36 */
    2537define( 'SMLY4WP_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
    2638
    27 require_once( SMLY4WP_PLUGIN_PATH . 'includes/activator.php' );
    28 require_once( SMLY4WP_PLUGIN_PATH . 'action.php' );
    29 register_activation_hook( __FILE__, 'smaily_install' );
     39/**
     40 * Absolute path to the core plugin file.
     41 */
     42define( 'SMLY4WP_PLUGIN_FILE', __FILE__ );
    3043
    3144/**
    32  * Initialize.
    33  *
    34  * @param mixed $hook Hook.
    35  * @return void
     45 * The core plugin class.
    3646 */
    37 function smaily_enqueue( $hook ) {
    38     wp_enqueue_script( 'smaily', plugins_url( '/js/default.js', __FILE__ ), array( 'jquery' ) );
    39     wp_localize_script( 'smaily', 'smaily', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) );
    40 }
    41 add_action( 'wp_enqueue_scripts', 'smaily_enqueue' );
    42 add_action( 'admin_enqueue_scripts', 'smaily_enqueue' );
     47require SMLY4WP_PLUGIN_PATH . 'includes/class-smaily-for-wp.php';
    4348
    4449/**
    45  * Load plugin textdomain.
     50 * Begins execution of the plugin.
    4651 *
    47  * @since 1.0.0
     52 * Since everything within the plugin is registered via hooks,
     53 * then kicking off the plugin from this point in the file does
     54 * not affect the page life cycle.
     55 *
     56 * @since 3.0.0
    4857 */
    49 function smaily_load_textdomain() {
    50     load_plugin_textdomain( 'smaily-for-wp', false, plugin_basename( SMLY4WP_PLUGIN_PATH ) . '/lang' );
     58function run_smaily_for_wp() {
     59    $plugin = new Smaily_For_WP();
     60    $plugin->run();
    5161}
    52 add_action( 'plugins_loaded', 'smaily_load_textdomain' );
    53 
    54 /**
    55  * Load subscribe widget.
    56  */
    57 function smaily_subscription_widget_init() {
    58     require_once( SMLY4WP_PLUGIN_PATH . 'includes/subscribe-widget.php' );
    59     register_widget( 'Smaily_Newsletter_Subscription_Widget' );
    60 }
    61 add_action( 'widgets_init', 'smaily_subscription_widget_init' );
    62 
    63 /**
    64  * Render admin page.
    65  *
    66  * @return void
    67  */
    68 function smaily_admin_render() {
    69     global $wpdb;
    70 
    71     // Create admin template.
    72     require_once( SMLY4WP_PLUGIN_PATH . '/code/Template.php' );
    73     $template = new Smaily_Plugin_Template( 'html/admin/page.php' );
    74 
    75     // Load configuration data.
    76     $table_name = esc_sql( $wpdb->prefix . 'smaily_config' );
    77     $data       = $wpdb->get_row( "SELECT * FROM `$table_name` LIMIT 1" );
    78     $template->assign( (array) $data );
    79 
    80     // Load autoresponders.
    81     $table_name = esc_sql( $wpdb->prefix . 'smaily_autoresponders' );
    82     $data       = $wpdb->get_results( "SELECT * FROM `$table_name`" );
    83     $template->assign( 'autoresponders', $data );
    84 
    85     // Add menu elements.
    86     add_menu_page( 'smaily', 'Smaily', 'manage_options', SMLY4WP_PLUGIN_PATH, '', plugins_url( 'gfx/icon.png', __FILE__ ) );
    87     add_submenu_page( 'smaily', 'Newsletter subscription form', 'Form', 'manage_options', SMLY4WP_PLUGIN_PATH, array( $template, 'dispatch' ) );
    88 }
    89 add_action( 'admin_menu', 'smaily_admin_render' );
    90 
    91 
    92 /**
    93  * Render smaily form using shortcode.
    94  *
    95  * @param array $atts shortcode attributes.
    96  * @return string
    97  */
    98 function smaily_shortcode_render( $atts ) {
    99     global $wpdb;
    100 
    101     // Load configuration data.
    102     $table_name = esc_sql( $wpdb->prefix . 'smaily_config' );
    103     $config = (array) $wpdb->get_row( "SELECT * FROM `$table_name` LIMIT 1" );
    104 
    105     // Parse attributes out of shortcode tag.
    106     $shortcode_atts = shortcode_atts(
    107         array(
    108             'success_url'      => get_site_url(),
    109             'failure_url'      => get_site_url(),
    110             'show_name'        => false,
    111             'autoresponder_id' => '',
    112         ),
    113         $atts
    114     );
    115     $config['success_url']      = $shortcode_atts['success_url'];
    116     $config['failure_url']      = $shortcode_atts['failure_url'];
    117     $config['show_name']        = $shortcode_atts['show_name'];
    118     $config['autoresponder_id'] = $shortcode_atts['autoresponder_id'];
    119 
    120     // Create admin template.
    121     require_once( SMLY4WP_PLUGIN_PATH . '/code/Template.php' );
    122     $file     = ( isset( $config['is_advanced'] ) && '1' === $config['is_advanced'] ) ? 'advanced.php' : 'basic.php';
    123     $template = new Smaily_Plugin_Template( 'html/form/' . $file );
    124     $template->assign( $config );
    125     // Display responses on Smaily subscription form.
    126     $form_has_response  = false;
    127     $form_is_successful = false;
    128     $response_message   = null;
    129 
    130     if ( ! isset( $config['api_credentials'] ) || empty( $config['api_credentials'] ) ) {
    131         $form_has_response = true;
    132         $response_message  = __( 'Smaily credentials not validated. Subscription form will not work!', 'smaily-for-wp' );
    133     } elseif ( isset( $_GET['code'] ) && (int) $_GET['code'] === 101 ) {
    134         $form_is_successful = true;
    135     } elseif ( isset( $_GET['code'] ) || ! empty( $_GET['code'] ) ) {
    136         $form_has_response = true;
    137         switch ( (int) $_GET['code'] ) {
    138             case 201:
    139                 $response_message = __( 'Form was not submitted using POST method.', 'smaily-for-wp' );
    140                 break;
    141             case 204:
    142                 $response_message = __( 'Input does not contain a recognizable email address.', 'smaily-for-wp' );
    143                 break;
    144             default:
    145                 $response_message = __( 'Could not add to subscriber list for an unknown reason. Probably something in Smaily.', 'smaily-for-wp' );
    146                 break;
    147         }
    148     }
    149 
    150     $template->assign(
    151         array(
    152             'form_has_response'  => $form_has_response,
    153             'response_message'   => $response_message,
    154             'form_is_successful' => $form_is_successful,
    155         )
    156     );
    157 
    158     // Render template.
    159     return $template->render();
    160 }
    161 add_shortcode( 'smaily_for_wp_newsletter_form', 'smaily_shortcode_render' );
     62run_smaily_for_wp();
  • smaily-for-wp/trunk/lang/smaily-for-wp-et.po

    r2451736 r2485930  
    22msgstr ""
    33"Project-Id-Version: Smaily for WP\n"
    4 "POT-Creation-Date: 2021-01-06 12:29+0200\n"
    5 "PO-Revision-Date: 2021-01-06 14:09+0200\n"
     4"POT-Creation-Date: 2021-02-18 11:58+0200\n"
     5"PO-Revision-Date: 2021-02-18 12:01+0200\n"
    66"Last-Translator: Smaily <[email protected]>\n"
    77"Language-Team: Smaily <[email protected]>\n"
     
    1818"X-Poedit-SearchPath-0: .\n"
    1919
    20 #: action.php:54
     20#: admin/class-smaily-for-wp-admin.php:190
    2121msgid "Please enter subdomain!"
    2222msgstr "Palun sisesta alamdomeen!"
    2323
    24 #: action.php:62
     24#: admin/class-smaily-for-wp-admin.php:194
    2525msgid "Please enter username!"
    2626msgstr "Palun sisesta kasutajatunnus!"
    2727
    28 #: action.php:70
     28#: admin/class-smaily-for-wp-admin.php:198
    2929msgid "Please enter password!"
    3030msgstr "Palun sisesta parool!"
    3131
    32 #: action.php:90
     32#: admin/class-smaily-for-wp-admin.php:214
    3333msgid "Wrong credentials"
    3434msgstr "Valed autentimise tunnused"
    3535
    36 #: action.php:97
     36#: admin/class-smaily-for-wp-admin.php:219
    3737msgid "Error in subdomain"
    3838msgstr "Viga alamdomeenis"
    3939
    40 #: action.php:111
     40#: admin/class-smaily-for-wp-admin.php:229
    4141msgid "Something went wrong with request to Smaily"
    4242msgstr "Ilmnes probleem Smaily-ga ühendamisel"
    4343
    44 #: action.php:146
     44#: admin/class-smaily-for-wp-admin.php:238
    4545msgid "Credentials validated."
    4646msgstr "Autentimise tunnused valideeritud."
    4747
    48 #: action.php:163
     48#: admin/class-smaily-for-wp-admin.php:255
    4949msgid "Credentials removed."
    5050msgstr "Autentimise tunnused eemaldatud."
    5151
    52 #: action.php:182
     52#: admin/class-smaily-for-wp-admin.php:272
    5353msgid "Newsletter subscription form reset to default."
    5454msgstr "Liitumisvormi kood taasloodud."
    5555
    56 #: action.php:208
    57 msgid "Could not find any autoresponders!"
    58 msgstr "Ei leidnud Automaatvastajaid!"
    59 
    60 #: action.php:232
    61 msgid "Autoresponders refreshed."
    62 msgstr "Automaatvastajad uuendatud."
    63 
    64 #: action.php:276
     56#: admin/class-smaily-for-wp-admin.php:312
    6557msgid "Changes saved."
    6658msgstr "Salvestatud."
    6759
    68 #: html/admin/html/form.php:13
     60#: admin/partials/smaily-for-wp-admin-form.php:8
    6961msgid "Your API credentials are valid"
    7062msgstr "Kasutajatunnused valideeritud"
    7163
    72 #: html/admin/html/form.php:14
     64#: admin/partials/smaily-for-wp-admin-form.php:9
    7365msgid "Remove"
    7466msgstr "Eemalda"
    7567
    76 #: html/admin/html/form.php:21
     68#: admin/partials/smaily-for-wp-admin-form.php:16
    7769msgid "Subdomain"
    7870msgstr "Alamdomeen"
    7971
    80 #: html/admin/html/form.php:31
     72#: admin/partials/smaily-for-wp-admin-form.php:26
    8173msgid "API username"
    8274msgstr "API kasutajatunnus"
    8375
    84 #: html/admin/html/form.php:35
     76#: admin/partials/smaily-for-wp-admin-form.php:30
    8577msgid "API password"
    8678msgstr "API salasõna"
    8779
    88 #: html/admin/html/form.php:40
     80#: admin/partials/smaily-for-wp-admin-form.php:35
    8981msgid "How to create API credentials?"
    9082msgstr "Kuidas luua API kasutaja?"
    9183
    92 #: html/admin/html/form.php:47
     84#: admin/partials/smaily-for-wp-admin-form.php:42
    9385msgid "Check"
    9486msgstr "Kontrolli"
    9587
    96 #: html/admin/html/form.php:53
     88#: admin/partials/smaily-for-wp-admin-form.php:48
    9789msgid "Basic"
    9890msgstr "Tavaseaded"
    9991
    100 #: html/admin/html/form.php:54
     92#: admin/partials/smaily-for-wp-admin-form.php:49
    10193msgid "Advanced"
    10294msgstr "Spetsialisti seaded"
    10395
    104 #: html/admin/html/form.php:60
    105 msgid "Autoresponders"
    106 msgstr "Automaatvastajad"
    107 
    108 #: html/admin/html/form.php:60
    109 msgid "Refresh"
    110 msgstr "Uuenda"
    111 
    112 #: html/admin/html/form.php:61
    113 msgid "Select autoresponder to change regular opt-in functionality"
    114 msgstr "Vali automaatika, et muuta tavalist opt-in funktsionaalsust"
    115 
    116 #: html/admin/html/form.php:64
    117 msgid "No autoresponder"
    118 msgstr "Ilma automaatvastajata vorm"
    119 
    120 #: html/admin/html/form.php:70
    121 msgid "No autoresponders. Please click on refresh link to update."
    122 msgstr "Automaatvastajad puuduvad. Uuendamiseks vajutage värskenda viidet."
    123 
    124 #: html/admin/html/form.php:77
     96#: admin/partials/smaily-for-wp-admin-form.php:55
    12597msgid "Newsletter subscription form"
    12698msgstr "Uudiskirja liitumisvorm"
    12799
    128 #: html/admin/html/form.php:77
     100#: admin/partials/smaily-for-wp-admin-form.php:55
    129101msgid "Restore original subscription form"
    130102msgstr "Taasta algne liitumisvorm"
    131103
    132 #: html/admin/html/form.php:77
     104#: admin/partials/smaily-for-wp-admin-form.php:55
    133105msgid "Regenerate"
    134106msgstr "Taastekita"
    135107
    136 #: html/admin/html/form.php:78
     108#: admin/partials/smaily-for-wp-admin-form.php:56
    137109msgid "HTML of subscription form"
    138110msgstr "Liitumisvormi HTML"
    139111
    140 #: html/admin/html/form.php:83
     112#: admin/partials/smaily-for-wp-admin-form.php:61
    141113msgid "Note: When you save under Basic tab, default form will be used."
    142114msgstr ""
    143115"Hoiatus: Kui salvestad Tavaseadete vaates, kasutatakse lehel vaikimisi vormi."
    144116
    145 #: html/admin/html/form.php:86
     117#: admin/partials/smaily-for-wp-admin-form.php:64
    146118msgid "Save changes"
    147119msgstr "Salvesta muudatused"
    148120
    149 #: html/admin/page.php:26
    150 msgid "Smaily Wordpress plugin"
    151 msgstr "Smaily Wordpressi pistikmoodul"
    152 
    153 #: html/admin/page.php:27
     121#: admin/partials/smaily-for-wp-admin-page.php:3
     122msgid "Smaily WordPress plugin"
     123msgstr "Smaily WordPressi pistikmoodul"
     124
     125#: admin/partials/smaily-for-wp-admin-page.php:4
    154126msgid "Please wait, working..."
    155127msgstr "Palun oota..."
    156128
    157 #: html/form/advanced.php:9 html/form/basic.php:3
    158 msgid "Thank you for subscribing to our newsletter."
    159 msgstr "Täname, et liitusite meie uudiskirjaga."
    160 
    161 #: html/form/advanced.php:16 html/form/basic.php:10
    162 msgid "Email"
    163 msgstr "E-post"
    164 
    165 #: html/form/advanced.php:18 html/form/basic.php:12
    166 msgid "Name"
    167 msgstr "Nimi"
    168 
    169 #: html/form/advanced.php:20 html/form/basic.php:14
    170 msgid "Subscribe"
    171 msgstr "Liitu"
    172 
    173 #: includes/subscribe-widget.php:18
     129#: includes/class-smaily-for-wp-widget.php:37
    174130msgid "Smaily newsletter subscription form"
    175131msgstr "Smaily uudiskirjaga liitumise vorm"
    176132
    177 #: includes/subscribe-widget.php:19
     133#: includes/class-smaily-for-wp-widget.php:38
    178134msgid "Smaily Newsletter Subscription"
    179135msgstr "Smaily uudiskirjaga liitumine"
    180136
    181 #: includes/subscribe-widget.php:63 smaily-for-wp.php:132
     137#: includes/class-smaily-for-wp-widget.php:89
     138#: public/class-smaily-for-wp-public.php:104
    182139msgid "Smaily credentials not validated. Subscription form will not work!"
    183140msgstr "Smaily kasutajatunnused on valideerimata.  Uudiskirja vorm ei tööta!"
    184141
    185 #: includes/subscribe-widget.php:70 smaily-for-wp.php:139
     142#: includes/class-smaily-for-wp-widget.php:96
     143#: public/class-smaily-for-wp-public.php:111
    186144msgid "Form was not submitted using POST method."
    187145msgstr "Andmeid peab saatma POST tegevusviisiga."
    188146
    189 #: includes/subscribe-widget.php:73 smaily-for-wp.php:142
     147#: includes/class-smaily-for-wp-widget.php:99
     148#: public/class-smaily-for-wp-public.php:114
    190149msgid "Input does not contain a recognizable email address."
    191150msgstr "Sisend ei sisalda tuntavat emaili aadressi."
    192151
    193 #: includes/subscribe-widget.php:76 smaily-for-wp.php:145
     152#: includes/class-smaily-for-wp-widget.php:102
     153#: public/class-smaily-for-wp-public.php:117
    194154msgid ""
    195155"Could not add to subscriber list for an unknown reason. Probably something "
     
    199159"probleem Smaily-s."
    200160
    201 #: includes/subscribe-widget.php:129
     161#: includes/class-smaily-for-wp-widget.php:166
    202162msgid "Title"
    203163msgstr "Pealkiri"
    204164
    205 #: includes/subscribe-widget.php:139
     165#: includes/class-smaily-for-wp-widget.php:176
    206166msgid "Display name field?"
    207167msgstr "Näita nime välja?"
    208168
    209 #: includes/subscribe-widget.php:146
     169#: includes/class-smaily-for-wp-widget.php:183
    210170msgid "Success URL"
    211171msgstr "Õnnestumise URL"
    212172
    213 #: includes/subscribe-widget.php:154
     173#: includes/class-smaily-for-wp-widget.php:191
    214174msgid "Failure URL"
    215175msgstr "Ebaõnnestumise URL"
     176
     177#: includes/class-smaily-for-wp-widget.php:199
     178msgid "Autoresponders"
     179msgstr "Automaatvastajad"
     180
     181#: includes/class-smaily-for-wp-widget.php:201
     182msgid "No autoresponder"
     183msgstr "Ilma automaatvastajata vorm"
     184
     185#: public/partials/smaily-for-wp-public-advanced.php:9
     186#: public/partials/smaily-for-wp-public-basic.php:3
     187msgid "Thank you for subscribing to our newsletter."
     188msgstr "Täname, et liitusite meie uudiskirjaga."
     189
     190#: public/partials/smaily-for-wp-public-advanced.php:16
     191#: public/partials/smaily-for-wp-public-basic.php:10
     192msgid "Email"
     193msgstr "E-post"
     194
     195#: public/partials/smaily-for-wp-public-advanced.php:18
     196#: public/partials/smaily-for-wp-public-basic.php:12
     197msgid "Name"
     198msgstr "Nimi"
     199
     200#: public/partials/smaily-for-wp-public-advanced.php:20
     201#: public/partials/smaily-for-wp-public-basic.php:14
     202msgid "Subscribe"
     203msgstr "Liitu"
  • smaily-for-wp/trunk/lang/smaily-for-wp.pot

    r2451736 r2485930  
    33msgstr ""
    44"Project-Id-Version: Smaily for WP\n"
    5 "POT-Creation-Date: 2021-01-06 14:06+0200\n"
     5"POT-Creation-Date: 2021-02-18 12:00+0200\n"
    66"PO-Revision-Date: 2021-01-05 20:12+0200\n"
    77"Last-Translator: Smaily <[email protected]>\n"
     
    1919"X-Poedit-SearchPath-0: .\n"
    2020
    21 #: action.php:54
     21#: admin/class-smaily-for-wp-admin.php:190
    2222msgid "Please enter subdomain!"
    2323msgstr ""
    2424
    25 #: action.php:62
     25#: admin/class-smaily-for-wp-admin.php:194
    2626msgid "Please enter username!"
    2727msgstr ""
    2828
    29 #: action.php:70
     29#: admin/class-smaily-for-wp-admin.php:198
    3030msgid "Please enter password!"
    3131msgstr ""
    3232
    33 #: action.php:90
     33#: admin/class-smaily-for-wp-admin.php:214
    3434msgid "Wrong credentials"
    3535msgstr ""
    3636
    37 #: action.php:97
     37#: admin/class-smaily-for-wp-admin.php:219
    3838msgid "Error in subdomain"
    3939msgstr ""
    4040
    41 #: action.php:111
     41#: admin/class-smaily-for-wp-admin.php:229
    4242msgid "Something went wrong with request to Smaily"
    4343msgstr ""
    4444
    45 #: action.php:146
     45#: admin/class-smaily-for-wp-admin.php:238
    4646msgid "Credentials validated."
    4747msgstr ""
    4848
    49 #: action.php:163
     49#: admin/class-smaily-for-wp-admin.php:255
    5050msgid "Credentials removed."
    5151msgstr ""
    5252
    53 #: action.php:182
     53#: admin/class-smaily-for-wp-admin.php:272
    5454msgid "Newsletter subscription form reset to default."
    5555msgstr ""
    5656
    57 #: action.php:208
    58 msgid "Could not find any autoresponders!"
    59 msgstr ""
    60 
    61 #: action.php:232
    62 msgid "Autoresponders refreshed."
    63 msgstr ""
    64 
    65 #: action.php:276
     57#: admin/class-smaily-for-wp-admin.php:312
    6658msgid "Changes saved."
    6759msgstr ""
    6860
    69 #: html/admin/html/form.php:13
     61#: admin/partials/smaily-for-wp-admin-form.php:8
    7062msgid "Your API credentials are valid"
    7163msgstr ""
    7264
    73 #: html/admin/html/form.php:14
     65#: admin/partials/smaily-for-wp-admin-form.php:9
    7466msgid "Remove"
    7567msgstr ""
    7668
    77 #: html/admin/html/form.php:21
     69#: admin/partials/smaily-for-wp-admin-form.php:16
    7870msgid "Subdomain"
    7971msgstr ""
    8072
    81 #: html/admin/html/form.php:31
     73#: admin/partials/smaily-for-wp-admin-form.php:26
    8274msgid "API username"
    8375msgstr ""
    8476
    85 #: html/admin/html/form.php:35
     77#: admin/partials/smaily-for-wp-admin-form.php:30
    8678msgid "API password"
    8779msgstr ""
    8880
    89 #: html/admin/html/form.php:40
     81#: admin/partials/smaily-for-wp-admin-form.php:35
    9082msgid "How to create API credentials?"
    9183msgstr ""
    9284
    93 #: html/admin/html/form.php:47
     85#: admin/partials/smaily-for-wp-admin-form.php:42
    9486msgid "Check"
    9587msgstr ""
    9688
    97 #: html/admin/html/form.php:53
     89#: admin/partials/smaily-for-wp-admin-form.php:48
    9890msgid "Basic"
    9991msgstr ""
    10092
    101 #: html/admin/html/form.php:54
     93#: admin/partials/smaily-for-wp-admin-form.php:49
    10294msgid "Advanced"
    10395msgstr ""
    10496
    105 #: html/admin/html/form.php:60
    106 msgid "Autoresponders"
    107 msgstr ""
    108 
    109 #: html/admin/html/form.php:60
    110 msgid "Refresh"
    111 msgstr ""
    112 
    113 #: html/admin/html/form.php:61
    114 msgid "Select autoresponder to change regular opt-in functionality"
    115 msgstr ""
    116 
    117 #: html/admin/html/form.php:64
    118 msgid "No autoresponder"
    119 msgstr ""
    120 
    121 #: html/admin/html/form.php:70
    122 msgid "No autoresponders. Please click on refresh link to update."
    123 msgstr ""
    124 
    125 #: html/admin/html/form.php:77
     97#: admin/partials/smaily-for-wp-admin-form.php:55
    12698msgid "Newsletter subscription form"
    12799msgstr ""
    128100
    129 #: html/admin/html/form.php:77
     101#: admin/partials/smaily-for-wp-admin-form.php:55
    130102msgid "Restore original subscription form"
    131103msgstr ""
    132104
    133 #: html/admin/html/form.php:77
     105#: admin/partials/smaily-for-wp-admin-form.php:55
    134106msgid "Regenerate"
    135107msgstr ""
    136108
    137 #: html/admin/html/form.php:78
     109#: admin/partials/smaily-for-wp-admin-form.php:56
    138110msgid "HTML of subscription form"
    139111msgstr ""
    140112
    141 #: html/admin/html/form.php:83
     113#: admin/partials/smaily-for-wp-admin-form.php:61
    142114msgid "Note: When you save under Basic tab, default form will be used."
    143115msgstr ""
    144116
    145 #: html/admin/html/form.php:86
     117#: admin/partials/smaily-for-wp-admin-form.php:64
    146118msgid "Save changes"
    147119msgstr ""
    148120
    149 #: html/admin/page.php:26
    150 msgid "Smaily Wordpress plugin"
    151 msgstr ""
    152 
    153 #: html/admin/page.php:27
     121#: admin/partials/smaily-for-wp-admin-page.php:3
     122msgid "Smaily WordPress plugin"
     123msgstr ""
     124
     125#: admin/partials/smaily-for-wp-admin-page.php:4
    154126msgid "Please wait, working..."
    155127msgstr ""
    156128
    157 #: html/form/advanced.php:9 html/form/basic.php:3
    158 msgid "Thank you for subscribing to our newsletter."
    159 msgstr ""
    160 
    161 #: html/form/advanced.php:16 html/form/basic.php:10
    162 msgid "Email"
    163 msgstr ""
    164 
    165 #: html/form/advanced.php:18 html/form/basic.php:12
    166 msgid "Name"
    167 msgstr ""
    168 
    169 #: html/form/advanced.php:20 html/form/basic.php:14
    170 msgid "Subscribe"
    171 msgstr ""
    172 
    173 #: includes/subscribe-widget.php:18
     129#: includes/class-smaily-for-wp-widget.php:37
    174130msgid "Smaily newsletter subscription form"
    175131msgstr ""
    176132
    177 #: includes/subscribe-widget.php:19
     133#: includes/class-smaily-for-wp-widget.php:38
    178134msgid "Smaily Newsletter Subscription"
    179135msgstr ""
    180136
    181 #: includes/subscribe-widget.php:63 smaily-for-wp.php:132
     137#: includes/class-smaily-for-wp-widget.php:89
     138#: public/class-smaily-for-wp-public.php:104
    182139msgid "Smaily credentials not validated. Subscription form will not work!"
    183140msgstr ""
    184141
    185 #: includes/subscribe-widget.php:70 smaily-for-wp.php:139
     142#: includes/class-smaily-for-wp-widget.php:96
     143#: public/class-smaily-for-wp-public.php:111
    186144msgid "Form was not submitted using POST method."
    187145msgstr ""
    188146
    189 #: includes/subscribe-widget.php:73 smaily-for-wp.php:142
     147#: includes/class-smaily-for-wp-widget.php:99
     148#: public/class-smaily-for-wp-public.php:114
    190149msgid "Input does not contain a recognizable email address."
    191150msgstr ""
    192151
    193 #: includes/subscribe-widget.php:76 smaily-for-wp.php:145
     152#: includes/class-smaily-for-wp-widget.php:102
     153#: public/class-smaily-for-wp-public.php:117
    194154msgid ""
    195155"Could not add to subscriber list for an unknown reason. Probably something "
     
    197157msgstr ""
    198158
    199 #: includes/subscribe-widget.php:129
     159#: includes/class-smaily-for-wp-widget.php:166
    200160msgid "Title"
    201161msgstr ""
    202162
    203 #: includes/subscribe-widget.php:139
     163#: includes/class-smaily-for-wp-widget.php:176
    204164msgid "Display name field?"
    205165msgstr ""
    206166
    207 #: includes/subscribe-widget.php:146
     167#: includes/class-smaily-for-wp-widget.php:183
    208168msgid "Success URL"
    209169msgstr ""
    210170
    211 #: includes/subscribe-widget.php:154
     171#: includes/class-smaily-for-wp-widget.php:191
    212172msgid "Failure URL"
    213173msgstr ""
     174
     175#: includes/class-smaily-for-wp-widget.php:199
     176msgid "Autoresponders"
     177msgstr ""
     178
     179#: includes/class-smaily-for-wp-widget.php:201
     180msgid "No autoresponder"
     181msgstr ""
     182
     183#: public/partials/smaily-for-wp-public-advanced.php:9
     184#: public/partials/smaily-for-wp-public-basic.php:3
     185msgid "Thank you for subscribing to our newsletter."
     186msgstr ""
     187
     188#: public/partials/smaily-for-wp-public-advanced.php:16
     189#: public/partials/smaily-for-wp-public-basic.php:10
     190msgid "Email"
     191msgstr ""
     192
     193#: public/partials/smaily-for-wp-public-advanced.php:18
     194#: public/partials/smaily-for-wp-public-basic.php:12
     195msgid "Name"
     196msgstr ""
     197
     198#: public/partials/smaily-for-wp-public-advanced.php:20
     199#: public/partials/smaily-for-wp-public-basic.php:14
     200msgid "Subscribe"
     201msgstr ""
  • smaily-for-wp/trunk/readme.txt

    r2451736 r2485930  
    44Requires PHP: 5.6
    55Requires at least: 4.0
    6 Stable tag: 2.3.0
     6Stable tag: 3.0.0
    77Tags: widget, plugin, sidebar, api, mail, email, marketing, smaily
    88Tested up to: 5.6.0
     
    7676== Changelog ==
    7777
     78= 3.0.0 =
     79- Autoresponders can be now be configured in widget settings and per widget.
     80- Fix spelling of plugin's admin page title.
     81- Plugin migrations are now automatically executed when plugin is updated.
     82
    7883= 2.3.0 =
    7984- Restructured plugin localizations (see upgrade notice section)
     
    107112== Upgrade Notice ==
    108113
     114= 3.0.0 =
     115
     116Since version 3.0.0, autoresponders can be configured in widget settings.
     117
    109118= 2.3.0 =
    110119
  • smaily-for-wp/trunk/smaily-for-wp.php

    r2451736 r2485930  
    1010 * Text Domain:       smaily-for-wp
    1111 * Description:       Smaily newsletter subscription form.
    12  * Version:           2.3.0
     12 * Version:           3.0.0
    1313 * Author:            Sendsmaily LLC
    1414 * Author URI:        https://smaily.com
     
    1717 */
    1818
    19 // Exit if accessed directly.
    20 if ( ! defined( 'ABSPATH' ) ) exit;
     19// If this file is called directly, abort.
     20if ( ! defined( 'ABSPATH' ) ) {
     21    die;
     22}
    2123
    22 define( 'SMLY4WP_PLUGIN_VERSION', '2.3.0' );
    23 // Absolute URL to the plugin, for HTML markup.
     24/**
     25 * Current plugin version.
     26 */
     27define( 'SMLY4WP_PLUGIN_VERSION', '3.0.0' );
     28
     29/**
     30 * Absolute URL to the Smaily for WP plugin directory.
     31 */
    2432define( 'SMLY4WP_PLUGIN_URL', plugins_url( '', __FILE__ ) );
     33
     34/**
     35 * Absolute path to the Smaily for WP plugin directory.
     36 */
    2537define( 'SMLY4WP_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
    2638
    27 require_once( SMLY4WP_PLUGIN_PATH . 'includes/activator.php' );
    28 require_once( SMLY4WP_PLUGIN_PATH . 'action.php' );
    29 register_activation_hook( __FILE__, 'smaily_install' );
     39/**
     40 * Absolute path to the core plugin file.
     41 */
     42define( 'SMLY4WP_PLUGIN_FILE', __FILE__ );
    3043
    3144/**
    32  * Initialize.
    33  *
    34  * @param mixed $hook Hook.
    35  * @return void
     45 * The core plugin class.
    3646 */
    37 function smaily_enqueue( $hook ) {
    38     wp_enqueue_script( 'smaily', plugins_url( '/js/default.js', __FILE__ ), array( 'jquery' ) );
    39     wp_localize_script( 'smaily', 'smaily', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) );
    40 }
    41 add_action( 'wp_enqueue_scripts', 'smaily_enqueue' );
    42 add_action( 'admin_enqueue_scripts', 'smaily_enqueue' );
     47require SMLY4WP_PLUGIN_PATH . 'includes/class-smaily-for-wp.php';
    4348
    4449/**
    45  * Load plugin textdomain.
     50 * Begins execution of the plugin.
    4651 *
    47  * @since 1.0.0
     52 * Since everything within the plugin is registered via hooks,
     53 * then kicking off the plugin from this point in the file does
     54 * not affect the page life cycle.
     55 *
     56 * @since 3.0.0
    4857 */
    49 function smaily_load_textdomain() {
    50     load_plugin_textdomain( 'smaily-for-wp', false, plugin_basename( SMLY4WP_PLUGIN_PATH ) . '/lang' );
     58function run_smaily_for_wp() {
     59    $plugin = new Smaily_For_WP();
     60    $plugin->run();
    5161}
    52 add_action( 'plugins_loaded', 'smaily_load_textdomain' );
    53 
    54 /**
    55  * Load subscribe widget.
    56  */
    57 function smaily_subscription_widget_init() {
    58     require_once( SMLY4WP_PLUGIN_PATH . 'includes/subscribe-widget.php' );
    59     register_widget( 'Smaily_Newsletter_Subscription_Widget' );
    60 }
    61 add_action( 'widgets_init', 'smaily_subscription_widget_init' );
    62 
    63 /**
    64  * Render admin page.
    65  *
    66  * @return void
    67  */
    68 function smaily_admin_render() {
    69     global $wpdb;
    70 
    71     // Create admin template.
    72     require_once( SMLY4WP_PLUGIN_PATH . '/code/Template.php' );
    73     $template = new Smaily_Plugin_Template( 'html/admin/page.php' );
    74 
    75     // Load configuration data.
    76     $table_name = esc_sql( $wpdb->prefix . 'smaily_config' );
    77     $data       = $wpdb->get_row( "SELECT * FROM `$table_name` LIMIT 1" );
    78     $template->assign( (array) $data );
    79 
    80     // Load autoresponders.
    81     $table_name = esc_sql( $wpdb->prefix . 'smaily_autoresponders' );
    82     $data       = $wpdb->get_results( "SELECT * FROM `$table_name`" );
    83     $template->assign( 'autoresponders', $data );
    84 
    85     // Add menu elements.
    86     add_menu_page( 'smaily', 'Smaily', 'manage_options', SMLY4WP_PLUGIN_PATH, '', plugins_url( 'gfx/icon.png', __FILE__ ) );
    87     add_submenu_page( 'smaily', 'Newsletter subscription form', 'Form', 'manage_options', SMLY4WP_PLUGIN_PATH, array( $template, 'dispatch' ) );
    88 }
    89 add_action( 'admin_menu', 'smaily_admin_render' );
    90 
    91 
    92 /**
    93  * Render smaily form using shortcode.
    94  *
    95  * @param array $atts shortcode attributes.
    96  * @return string
    97  */
    98 function smaily_shortcode_render( $atts ) {
    99     global $wpdb;
    100 
    101     // Load configuration data.
    102     $table_name = esc_sql( $wpdb->prefix . 'smaily_config' );
    103     $config = (array) $wpdb->get_row( "SELECT * FROM `$table_name` LIMIT 1" );
    104 
    105     // Parse attributes out of shortcode tag.
    106     $shortcode_atts = shortcode_atts(
    107         array(
    108             'success_url'      => get_site_url(),
    109             'failure_url'      => get_site_url(),
    110             'show_name'        => false,
    111             'autoresponder_id' => '',
    112         ),
    113         $atts
    114     );
    115     $config['success_url']      = $shortcode_atts['success_url'];
    116     $config['failure_url']      = $shortcode_atts['failure_url'];
    117     $config['show_name']        = $shortcode_atts['show_name'];
    118     $config['autoresponder_id'] = $shortcode_atts['autoresponder_id'];
    119 
    120     // Create admin template.
    121     require_once( SMLY4WP_PLUGIN_PATH . '/code/Template.php' );
    122     $file     = ( isset( $config['is_advanced'] ) && '1' === $config['is_advanced'] ) ? 'advanced.php' : 'basic.php';
    123     $template = new Smaily_Plugin_Template( 'html/form/' . $file );
    124     $template->assign( $config );
    125     // Display responses on Smaily subscription form.
    126     $form_has_response  = false;
    127     $form_is_successful = false;
    128     $response_message   = null;
    129 
    130     if ( ! isset( $config['api_credentials'] ) || empty( $config['api_credentials'] ) ) {
    131         $form_has_response = true;
    132         $response_message  = __( 'Smaily credentials not validated. Subscription form will not work!', 'smaily-for-wp' );
    133     } elseif ( isset( $_GET['code'] ) && (int) $_GET['code'] === 101 ) {
    134         $form_is_successful = true;
    135     } elseif ( isset( $_GET['code'] ) || ! empty( $_GET['code'] ) ) {
    136         $form_has_response = true;
    137         switch ( (int) $_GET['code'] ) {
    138             case 201:
    139                 $response_message = __( 'Form was not submitted using POST method.', 'smaily-for-wp' );
    140                 break;
    141             case 204:
    142                 $response_message = __( 'Input does not contain a recognizable email address.', 'smaily-for-wp' );
    143                 break;
    144             default:
    145                 $response_message = __( 'Could not add to subscriber list for an unknown reason. Probably something in Smaily.', 'smaily-for-wp' );
    146                 break;
    147         }
    148     }
    149 
    150     $template->assign(
    151         array(
    152             'form_has_response'  => $form_has_response,
    153             'response_message'   => $response_message,
    154             'form_is_successful' => $form_is_successful,
    155         )
    156     );
    157 
    158     // Render template.
    159     return $template->render();
    160 }
    161 add_shortcode( 'smaily_for_wp_newsletter_form', 'smaily_shortcode_render' );
     62run_smaily_for_wp();
Note: See TracChangeset for help on using the changeset viewer.