Plugin Directory

Changeset 2772043


Ignore:
Timestamp:
08/18/2022 11:14:27 AM (3 years ago)
Author:
bogdanfix
Message:

release 1.1.0 version to trunk and update readme;

Location:
wp-sendfox/trunk
Files:
10 added
4 edited

Legend:

Unmodified
Added
Removed
  • wp-sendfox/trunk/lang/sf4wp.pot

    r2522017 r2772043  
    33msgstr ""
    44"Project-Id-Version: SendFox for Wordpress\n"
    5 "POT-Creation-Date: 2021-04-27 16:42+0600\n"
     5"POT-Creation-Date: 2022-08-17 17:12+0600\n"
    66"PO-Revision-Date: 2020-03-03 17:39+0600\n"
    77"Last-Translator: \n"
     
    1717"X-Poedit-SearchPath-0: .\n"
    1818
     19#: includes/gutenberg/gutenberg-email-optin.php:53
     20msgid ""
     21"A customizable email optin block that allows to let people subscribe to "
     22"your SendFox lists"
     23msgstr ""
     24
     25#: includes/gutenberg/gutenberg-email-optin.php:55
     26msgid "Can not retrieve lists from SendFox. Please, check your API key."
     27msgstr ""
     28
     29#: includes/gutenberg/gutenberg-email-optin.php:57
     30msgid "Form Heading"
     31msgstr ""
     32
     33#: includes/gutenberg/gutenberg-email-optin.php:59
     34msgid "Enter form heading..."
     35msgstr ""
     36
     37#: includes/gutenberg/gutenberg-email-optin.php:61
     38msgid "Form Description"
     39msgstr ""
     40
     41#: includes/gutenberg/gutenberg-email-optin.php:63
     42msgid "Enter form description..."
     43msgstr ""
     44
     45#: includes/gutenberg/gutenberg-email-optin.php:65
     46msgid "Select SendFox List"
     47msgstr ""
     48
     49#: includes/gutenberg/gutenberg-email-optin.php:67
     50msgid "Button Label"
     51msgstr ""
     52
     53#: includes/gutenberg/gutenberg-email-optin.php:69
     54msgid "Enter button label..."
     55msgstr ""
     56
     57#: includes/gutenberg/gutenberg-email-optin.php:71
     58msgid "Heading Text Color"
     59msgstr ""
     60
     61#: includes/gutenberg/gutenberg-email-optin.php:73
     62msgid "Description Text Color"
     63msgstr ""
     64
     65#: includes/gutenberg/gutenberg-email-optin.php:75
     66msgid "Button Label Color"
     67msgstr ""
     68
     69#: includes/gutenberg/gutenberg-email-optin.php:77
     70msgid "Button Background Color"
     71msgstr ""
     72
     73#: includes/gutenberg/gutenberg-email-optin.php:79
     74msgid "Form Background Color"
     75msgstr ""
     76
     77#: includes/gutenberg/gutenberg-email-optin.php:81
     78msgid "Form Background Image"
     79msgstr ""
     80
     81#: includes/gutenberg/gutenberg-email-optin.php:83
     82msgid "Upload Image"
     83msgstr ""
     84
     85#: includes/gutenberg/gutenberg-email-optin.php:85
     86msgid "Remove Image"
     87msgstr ""
     88
     89#: includes/gutenberg/gutenberg-email-optin.php:87
     90msgid "First name"
     91msgstr ""
     92
     93#: includes/gutenberg/gutenberg-email-optin.php:89
     94msgid "Last name"
     95msgstr ""
     96
     97#: includes/gutenberg/gutenberg-email-optin.php:91
     98msgid "Email"
     99msgstr ""
     100
     101#: includes/gutenberg/gutenberg-email-optin.php:124
     102msgid "All fields are required."
     103msgstr ""
     104
     105#: includes/gutenberg/gutenberg-email-optin.php:126
     106msgid "You have entered an invalid email address."
     107msgstr ""
     108
     109#: includes/gutenberg/gutenberg-email-optin.php:128
     110msgid "Unable to process request. Please, contact support."
     111msgstr ""
     112
     113#: includes/gutenberg/gutenberg-email-optin.php:130
     114msgid "Thanks for subscribing!"
     115msgstr ""
     116
    19117#: wp-sendfox-admin.php:89
    20118msgid "Thank you for using this plugin. You are amazing!"
     
    25123msgstr ""
    26124
    27 #: wp-sendfox-admin.php:100 wp-sendfox-admin.php:271
     125#: wp-sendfox-admin.php:100 wp-sendfox-admin.php:288
    28126msgid "Integrations"
    29127msgstr ""
     
    49147msgstr ""
    50148
    51 #: wp-sendfox-admin.php:157 wp-sendfox.php:393
     149#: wp-sendfox-admin.php:157 wp-sendfox.php:381
    52150msgid "Error: Response Status"
    53151msgstr ""
     
    120218msgstr ""
    121219
    122 #: wp-sendfox-admin.php:259
     220#: wp-sendfox-admin.php:262
    123221msgid "WooCommerce Checkout"
    124222msgstr ""
    125223
    126 #: wp-sendfox-admin.php:260
     224#: wp-sendfox-admin.php:263
    127225msgid "Subscribes people from WooCommerce's checkout form"
    128226msgstr ""
    129227
    130 #: wp-sendfox-admin.php:272
     228#: wp-sendfox-admin.php:269
     229msgid "Divi Email Optin"
     230msgstr ""
     231
     232#: wp-sendfox-admin.php:270
     233msgid "Adds SendFox to the list of providers in Divi's Email Optin block"
     234msgstr ""
     235
     236#: wp-sendfox-admin.php:276
     237msgid "Gutenberg Email Optin"
     238msgstr ""
     239
     240#: wp-sendfox-admin.php:277
     241msgid ""
     242"Adds new customizable Email Optin block to Gutenberg. Pick a list and let "
     243"everybody subscribe from any page."
     244msgstr ""
     245
     246#: wp-sendfox-admin.php:289
    131247msgid "back to all integrations"
    132248msgstr ""
    133249
    134 #: wp-sendfox-admin.php:281
     250#: wp-sendfox-admin.php:298
    135251msgid ""
    136252"The table below shows all available integrations. Click on the name of an "
     
    138254msgstr ""
    139255
    140 #: wp-sendfox-admin.php:289
     256#: wp-sendfox-admin.php:306
    141257msgid "integration settings"
    142258msgstr ""
    143259
    144 #: wp-sendfox-admin.php:306
     260#: wp-sendfox-admin.php:323
    145261msgid "Name"
    146262msgstr ""
    147263
    148 #: wp-sendfox-admin.php:307
     264#: wp-sendfox-admin.php:324
    149265msgid "Description"
    150266msgstr ""
    151267
    152 #: wp-sendfox-admin.php:308
     268#: wp-sendfox-admin.php:325
    153269msgid "Status"
    154270msgstr ""
    155271
    156 #: wp-sendfox-admin.php:317
     272#: wp-sendfox-admin.php:334
    157273msgid "Configure this integration"
    158274msgstr ""
    159275
    160 #: wp-sendfox-admin.php:357
     276#: wp-sendfox-admin.php:374 wp-sendfox-admin.php:598 wp-sendfox-admin.php:635
    161277msgid "Enable?"
    162278msgstr ""
    163279
    164 #: wp-sendfox-admin.php:367 wp-sendfox-admin.php:385 wp-sendfox-admin.php:405
    165 #: wp-sendfox-admin.php:487
     280#: wp-sendfox-admin.php:384 wp-sendfox-admin.php:402 wp-sendfox-admin.php:422
     281#: wp-sendfox-admin.php:504 wp-sendfox-admin.php:524 wp-sendfox-admin.php:608
     282#: wp-sendfox-admin.php:645
    166283msgid "yes"
    167284msgstr ""
    168285
    169 #: wp-sendfox-admin.php:369
     286#: wp-sendfox-admin.php:386
    170287#, php-format
    171288msgid ""
     
    173290msgstr ""
    174291
    175 #: wp-sendfox-admin.php:375
     292#: wp-sendfox-admin.php:392
    176293msgid "Implicit?"
    177294msgstr ""
    178295
    179 #: wp-sendfox-admin.php:387
     296#: wp-sendfox-admin.php:404
    180297msgid ""
    181298"Select \"yes\" if you want to subscribe people without asking them "
     
    183300msgstr ""
    184301
    185 #: wp-sendfox-admin.php:389
     302#: wp-sendfox-admin.php:406
    186303msgid "Does not bypass the double opt-in on Free & Lifetime plans."
    187304msgstr ""
    188305
    189 #: wp-sendfox-admin.php:395
     306#: wp-sendfox-admin.php:412
    190307msgid "Pre-checked?"
    191308msgstr ""
    192309
    193 #: wp-sendfox-admin.php:407
     310#: wp-sendfox-admin.php:424
    194311msgid "Select \"yes\" if the checkbox should be pre-checked."
    195312msgstr ""
    196313
    197 #: wp-sendfox-admin.php:413
     314#: wp-sendfox-admin.php:430
    198315msgid "SendFox list"
    199316msgstr ""
    200317
    201 #: wp-sendfox-admin.php:425 wp-sendfox-admin.php:585
     318#: wp-sendfox-admin.php:442 wp-sendfox-admin.php:698
    202319msgid "are you connected to SendFox?"
    203320msgstr ""
    204321
    205 #: wp-sendfox-admin.php:436
     322#: wp-sendfox-admin.php:453
    206323msgid "select the list..."
    207324msgstr ""
    208325
    209 #: wp-sendfox-admin.php:459
     326#: wp-sendfox-admin.php:476
    210327msgid "Checkbox label text"
    211328msgstr ""
    212329
    213 #: wp-sendfox-admin.php:471
     330#: wp-sendfox-admin.php:488
    214331msgid ""
    215332"HTML tags like <code>&lt;strong&gt&lt;em&gt&lt;a&gt</code> are allowed in "
     
    217334msgstr ""
    218335
    219 #: wp-sendfox-admin.php:477
     336#: wp-sendfox-admin.php:494
    220337msgid "Load default CSS?"
    221338msgstr ""
    222339
    223 #: wp-sendfox-admin.php:489
     340#: wp-sendfox-admin.php:506
    224341msgid "Select \"yes\" if the checkbox looks sloppy."
    225342msgstr ""
    226343
    227 #: wp-sendfox-admin.php:497
     344#: wp-sendfox-admin.php:514
     345msgid "Manual comment approval check?"
     346msgstr ""
     347
     348#: wp-sendfox-admin.php:526
     349msgid ""
     350"Submit email to SendFox after comment was approved manually. Otherwise, "
     351"only emails from auto approved comments will be submitted."
     352msgstr ""
     353
     354#: wp-sendfox-admin.php:536
    228355msgid "Position on checkout"
    229356msgstr ""
    230357
    231 #: wp-sendfox-admin.php:502
     358#: wp-sendfox-admin.php:541
    232359msgid "select the position..."
    233360msgstr ""
    234361
    235 #: wp-sendfox-admin.php:511
     362#: wp-sendfox-admin.php:550
    236363msgid "After billing details"
    237364msgstr ""
    238365
    239 #: wp-sendfox-admin.php:512
     366#: wp-sendfox-admin.php:551
    240367msgid "After shipping details"
    241368msgstr ""
    242369
    243 #: wp-sendfox-admin.php:513
     370#: wp-sendfox-admin.php:552
    244371msgid "After customer details"
    245372msgstr ""
    246373
    247 #: wp-sendfox-admin.php:514
     374#: wp-sendfox-admin.php:553
    248375msgid "Before submit button"
    249376msgstr ""
    250377
    251 #: wp-sendfox-admin.php:515
     378#: wp-sendfox-admin.php:554
    252379msgid "After order notes"
    253380msgstr ""
    254381
    255 #: wp-sendfox-admin.php:557
     382#: wp-sendfox-admin.php:593
     383msgid ""
     384"Important: Please, make sure only one Divi Theme or Divi Builder is "
     385"enabled on your site. Either one theme or one plugin."
     386msgstr ""
     387
     388#: wp-sendfox-admin.php:610
     389#, php-format
     390msgid ""
     391"Enable the %s integration? This will add SendFox to the list of email "
     392"providers in Divi."
     393msgstr ""
     394
     395#: wp-sendfox-admin.php:646
     396#, php-format
     397msgid ""
     398"Enable the %s integration? This will add new Email Optin block to "
     399"Gutenberg blocks."
     400msgstr ""
     401
     402#: wp-sendfox-admin.php:670
    256403msgid "Export your contacts"
    257404msgstr ""
    258405
    259 #: wp-sendfox-admin.php:561
     406#: wp-sendfox-admin.php:674
    260407msgid ""
    261408"Here you can export either all your Wordpress user emails or all your "
     
    263410msgstr ""
    264411
    265 #: wp-sendfox-admin.php:563
     412#: wp-sendfox-admin.php:676
    266413msgid "If email already exists in your list(s), it will be ignored."
    267414msgstr ""
    268415
    269 #: wp-sendfox-admin.php:567
     416#: wp-sendfox-admin.php:680
    270417msgid ""
    271418"To start pick the destination and source below and click \"Start export\":"
    272419msgstr ""
    273420
    274 #: wp-sendfox-admin.php:572
     421#: wp-sendfox-admin.php:685
    275422msgid "Pick the List (export destination):"
    276423msgstr ""
    277424
    278 #: wp-sendfox-admin.php:605
     425#: wp-sendfox-admin.php:718
    279426msgid "Pick Export mode (export source):"
    280427msgstr ""
    281428
    282 #: wp-sendfox-admin.php:609
     429#: wp-sendfox-admin.php:722
    283430msgid "Export Wordpress user emails"
    284431msgstr ""
    285432
    286 #: wp-sendfox-admin.php:610
     433#: wp-sendfox-admin.php:723
    287434msgid "Export WooCommerce customer emails"
    288435msgstr ""
    289436
    290 #: wp-sendfox-admin.php:615
     437#: wp-sendfox-admin.php:728
    291438msgid "Do not close or reload the page during export."
    292439msgstr ""
    293440
    294 #: wp-sendfox-admin.php:627
     441#: wp-sendfox-admin.php:740
    295442msgid "Start export"
    296443msgstr ""
    297444
    298 #: wp-sendfox-admin.php:631
     445#: wp-sendfox-admin.php:744
    299446msgid "Contacts exported successfully:"
    300447msgstr ""
    301448
    302 #: wp-sendfox-admin.php:632
     449#: wp-sendfox-admin.php:745
    303450msgid "Contacts not exported:"
    304451msgstr ""
    305452
    306 #: wp-sendfox-admin.php:876
     453#: wp-sendfox-admin.php:989
    307454msgid "Logged data"
    308455msgstr ""
    309456
    310 #: wp-sendfox-admin.php:880
     457#: wp-sendfox-admin.php:993
    311458msgid ""
    312459"Here you can find the detailed description of all the SendFox API requests "
     
    314461msgstr ""
    315462
    316 #: wp-sendfox-admin.php:891
     463#: wp-sendfox-admin.php:1004
    317464msgid "Log was cleared successfully."
    318465msgstr ""
    319466
    320 #: wp-sendfox-admin.php:899
     467#: wp-sendfox-admin.php:1012
    321468msgid "Oops, log is empty..."
    322469msgstr ""
    323470
    324 #: wp-sendfox-admin.php:913
     471#: wp-sendfox-admin.php:1026
    325472msgid "Clear log"
    326473msgstr ""
    327474
    328 #: wp-sendfox.php:131
     475#: wp-sendfox.php:126
    329476msgid "Oops, you can't access this page."
    330477msgstr ""
    331478
    332 #: wp-sendfox.php:295
     479#: wp-sendfox.php:283
    333480msgid "API Key is not set."
    334481msgstr ""
    335482
    336 #: wp-sendfox.php:353
     483#: wp-sendfox.php:341
    337484msgid "JSON Parse"
    338485msgstr ""
  • wp-sendfox/trunk/readme.txt

    r2522017 r2772043  
    44Tags: sendfox, integration, woocommerce, wordpress, wp, export, emails, users, api
    55Requires at least: 4.6
    6 Tested up to: 5.7
     6Tested up to: 6.0
    77Requires PHP: 5.2.4
    8 Stable tag: 1.0.2
     8Stable tag: 1.1.0
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
    1111
    12 Capture emails and add them to your SendFox list via comments, registration or WooCommerce checkout. Export your WP users and WooCommerce customers to your list.
     12Capture emails and add them to your SendFox list via comments, registration, WooCommerce checkout, Gutenberg page or Divi Builder page. Export your WP users and WooCommerce customers to your list.
    1313
    1414== Description ==
    1515
    16 This plugin lets you capture emails from your WP comment form, WP registration form and WooCommerce checkout form.
     16This plugin lets you capture emails from your WP comment form, WP registration form, WooCommerce checkout form, pages built with Gutenberg and Divi Builder.
    1717
    1818You can:
     
    2525All you need to start using this plugin is your SendFox API key (aka "Personal Access Token").
    2626
    27 SendFox website, title and logo are owned by [Sumo Group, Inc.](https://sumo.com/?utm_source=sf4wp&utm_medium=web&utm_campaign=wpplugindesc)
     27###### SendFox website, title and logo are owned by [Sumo Group, Inc.](https://sumo.com/?utm_source=sf4wp&utm_medium=web&utm_campaign=wpplugindesc) ######
    2828
    2929== Installation ==
     
    51514. WooCommerce Checkout integration screen. Capture emails of those who buys in your store.
    52525. Export screen. Export emails of WordPress users or WooCommerce customers to your SendFox list.
     536. Gutenberg Editor. New Email Optin block connected to your SendFox account.
     547. Divi Builder. SendFox added to the list of email providers in Divi Email Optin block.
    5355
    5456== Changelog ==
     57
     58= 1.1.0 =
     59* feature: integrated SendFox to the Divi Builder's Email Optin module (Big thanks to Rodolfo Martinez!);
     60* feature: added a custom Gutenberg Email Optin block that allows to pick a list and subscribe to SendFox (Big thanks to Rodolfo Martinez!);
     61* feature: (optionally) submit comment author email to SendFox only after comment is approved manually;
     62* tweak: submit comment author email to SendFox only after comment is approved automatically;
     63* tweak: replaced esc_url with esc_attr to fix "Clear log" link;
    5564
    5665= 1.0.2 =
     
    6877== Upgrade Notice ==
    6978
     79= 1.1.0 =
     80Integration for Divi, Gutenberg opt-in block, spam fix for Comment Form integration.
     81
    7082= 1.0.2 =
    7183A couple of minor tweaks + speed improvement.
  • wp-sendfox/trunk/wp-sendfox-admin.php

    r2522017 r2772043  
    256256                    'description' => __( 'Subscribes people from your WordPress registration form', 'sf4wp' ),
    257257                ),
     258
     259                // WooCommerce checkout integration
     260
    258261                'woocommerce-checkout' => array(
    259262                    'title' => __( 'WooCommerce Checkout', 'sf4wp' ),
    260263                    'description' => __( 'Subscribes people from WooCommerce\'s checkout form', 'sf4wp' ),
     264                ),
     265
     266                // Divi Builder integration
     267
     268                'divi' => array(
     269                    'title' => __( 'Divi Email Optin', 'sf4wp' ),
     270                    'description' => __( 'Adds SendFox to the list of providers in Divi\'s Email Optin block', 'sf4wp' ),
     271                ),
     272
     273                // Gutenberg integration
     274
     275                'gutenberg' => array(
     276                    'title' => __( 'Gutenberg Email Optin', 'sf4wp' ),
     277                    'description' => __( 'Adds new customizable Email Optin block to Gutenberg. Pick a list and let everybody subscribe from any page.', 'sf4wp' ),
    261278                ),
    262279            );
     
    492509                    </tr>
    493510
     511                <?php if( 'wp-comment-form' === $integration ): ?>
     512
     513                    <tr>
     514                        <th><?php _e( 'Manual comment approval check?', 'sf4wp' ); ?></th>
     515                        <td>
     516                           
     517                            <input
     518                                type="checkbox"
     519                                name="gb_sf4wp_options[<?php echo $integration; ?>][approved_check]"
     520                                value="1"
     521                                <?php
     522                                echo ( !empty( $options[ $integration ]['approved_check'] ) ?
     523                                    checked( $options[ $integration ]['approved_check'], '1', FALSE ) : '' );
     524                                ?> /> <?php _e( 'yes', 'sf4wp' ); ?>
     525
     526                            <p class="hint"><?php _e( 'Submit email to SendFox after comment was approved manually. Otherwise, only emails from auto approved comments will be submitted.', 'sf4wp' ); ?></p>
     527
     528                        </td>
     529                    </tr>
     530
     531                <?php endif; ?>
     532
    494533                <?php if( 'woocommerce-checkout' === $integration ): ?>
    495534
     
    543582
    544583<?php
     584                elseif(
     585                    'divi' === $integration
     586                ):
     587
     588                    if( empty( $options[ $integration ] ) )
     589                    {
     590                        $options[ $integration ] = array();
     591                    }
     592?>
     593                <p><b><?php _e( 'Important: Please, make sure only one Divi Theme or Divi Builder is enabled on your site. Either one theme or one plugin.', 'sf4wp' ); ?></b></p>
     594
     595                <table class="form-table"><tbody>
     596
     597                    <tr>
     598                        <th><?php _e( 'Enable?', 'sf4wp' ); ?></th>
     599                        <td>
     600                           
     601                            <input
     602                                type="checkbox"
     603                                name="gb_sf4wp_options[<?php echo $integration; ?>][enabled]"
     604                                value="1"
     605                                <?php
     606                                echo ( !empty( $options[ $integration ]['enabled'] ) ?
     607                                    checked( $options[ $integration ]['enabled'], '1', FALSE ) : '' );
     608                                ?> /> <?php _e( 'yes', 'sf4wp' ); ?>
     609
     610                            <p class="hint"><?php echo sprintf( __( 'Enable the %s integration? This will add SendFox to the list of email providers in Divi.', 'sf4wp' ), $all_integrations[ $integration ]['title'] ); ?></p>
     611
     612                        </td>
     613                    </tr>
     614
     615                </tbody></table>
     616
     617                <?php // to help pre_update_option function process single checkbox properly ?>
     618                <input type="hidden" name="gb_sf4wp_options[<?php echo $integration; ?>][dummy]" value="1" />
     619
     620                <div>
     621                    <?php submit_button(); ?>
     622                </div>
     623
     624<?php
     625                elseif(
     626                    'gutenberg' === $integration
     627                ):
     628                    if( empty( $options[ $integration ] ) )
     629                    {
     630                        $options[ $integration ] = array();
     631                    }
     632?>
     633                <table class="form-table"><tbody>
     634                    <tr>
     635                        <th><?php _e( 'Enable?', 'sf4wp' ); ?></th>
     636                        <td>
     637                           
     638                            <input
     639                                type="checkbox"
     640                                name="gb_sf4wp_options[<?php echo $integration; ?>][enabled]"
     641                                value="1"
     642                                <?php
     643                                echo ( !empty( $options[ $integration ]['enabled'] ) ?
     644                                    checked( $options[ $integration ]['enabled'], '1', FALSE ) : '' );
     645                                ?> /> <?php _e( 'yes', 'sf4wp' ); ?>
     646                            <p class="hint"><?php echo sprintf( __( 'Enable the %s integration? This will add new Email Optin block to Gutenberg blocks.', 'sf4wp' ), $all_integrations[ $integration ]['title'] ); ?></p>
     647                        </td>
     648                    </tr>
     649                </tbody></table>
     650                <?php // to help pre_update_option function process single checkbox properly ?>
     651                <input type="hidden" name="gb_sf4wp_options[<?php echo $integration; ?>][dummy]" value="1" />
     652                <div>
     653                    <?php submit_button(); ?>
     654                </div>
     655
     656
     657<?php
    545658                endif;
    546659?>
     
    8911004                    echo '<p><b>' . __( 'Log was cleared successfully.', 'sf4wp' ) . '</b></p>';
    8921005
    893                     echo '<script type="text/javascript">document.location.replace("admin.php?page=' . esc_url( $_GET['page'] ) . '&tab=log");</script>';
     1006                    echo '<script type="text/javascript">document.location.replace("admin.php?page=' . esc_attr( $_GET['page'] ) . '&tab=log");</script>';
    8941007                }
    8951008            }
     
    9111024            echo '<div><textarea>' . trim( $contents ) . '</textarea></div>';
    9121025
    913             echo '<div><br /><a href="admin.php?page=' . esc_url( $_GET['page'] ) . '&tab=log&clear-log=1" class="button button-secondary">' . __( 'Clear log', 'sf4wp' ) . '</a></div>';
     1026            echo '<div><br /><a href="admin.php?page=' . esc_attr( $_GET['page'] ) . '&tab=log&clear-log=1" class="button button-secondary">' . __( 'Clear log', 'sf4wp' ) . '</a></div>';
    9141027?>
    9151028
  • wp-sendfox/trunk/wp-sendfox.php

    r2522017 r2772043  
    33Plugin Name: WP SendFox
    44Plugin URI: https://wordpress.org/plugins/wp-sendfox/
    5 Description: Capture emails and add them to your SendFox list via comments, registration or WooCommerce checkout. Export your WP users and WooCommerce customers to your list.
     5Description: Capture emails and add them to your SendFox list via comments, registration, WooCommerce checkout, Gutenberg page or Divi Builder page. Export your WP users and WooCommerce customers to your list.
    66Author: BogdanFix
    77Author URI: https://bogdanfix.com/
    8 Version: 1.0.2
     8Version: 1.1.0
    99Text Domain: sf4wp
    1010Domain Path: /lang
     
    1616
    1717define( 'GB_SF4WP_NAME', 'SendFox for WordPress' );
    18 define( 'GB_SF4WP_VER', '1.0.2' );
     18define( 'GB_SF4WP_VER', '1.1.0' );
    1919define( 'GB_SF4WP_ID', 'wp-sendfox' );
    2020
     
    3535
    3636    add_action( 'comment_form_after_fields', 'gb_sf4wp_comment_form' );
    37 
    38     // if( !is_user_logged_in() )
    39     // {
    40         // add_action( 'comment_form', 'gb_sf4wp_comment_form' );
    41     // }
    4237
    4338    // registration form
     
    132127    }
    133128
    134     // if( !class_exists( 'WC_Payment_Gateway' ) )
    135     // {
    136     //     wp_die( __( 'Oops, this plugin needs WooCommerce plugin to be active.', 'sf4wp' ) );
    137     // }
    138 
    139129    include_once 'wp-sendfox-admin.php';
    140130}
     
    241231                }
    242232            }
    243 
    244             // add button to clear transients
    245233
    246234            // update data in the final response
     
    524512 */
    525513
    526 function gb_sf4wp_comment_post( $comment_id )
     514function gb_sf4wp_comment_post( $comment_id, $comment_approved )
    527515{
    528516    if( !empty( $_POST['sf4wp-subscribe'] ) )
     
    533521        {
    534522            $options = get_option( 'gb_sf4wp_options' );
     523
     524            // either process email from auto-approved comment or
     525            // from manually approved one, when status transition happens
     526
     527            if( $comment_approved == 0 )
     528            {
     529                // mark comment data to be sent to SendFox only after approval
     530
     531                if( !empty( $options['wp-comment-form']['approved_check'] ) )
     532                {
     533                    add_comment_meta( $comment_id, 'sf4wp_send', 1, TRUE );
     534
     535                    return;
     536                }
     537                else
     538                {
     539                    return;
     540                }
     541            }
     542
     543            // if comment data is submitted instantly
    535544
    536545            if(
     
    558567    }
    559568}
    560 add_action( 'comment_post', 'gb_sf4wp_comment_post' );
     569add_action( 'comment_post', 'gb_sf4wp_comment_post', 10, 2 );
     570
     571/**
     572 * Comment Form: process manual comment approval
     573 *
     574 * @since 1.1.0
     575 */
     576
     577function gb_sf4wp_comment_approved( $new_status, $old_status, $comment )
     578{
     579    if( $old_status === $new_status )
     580    {
     581        return;
     582    }
     583
     584    if( $new_status !== 'approved' )
     585    {
     586        return;
     587    }
     588
     589    if(
     590        !empty( $comment ) &&
     591        !empty( $comment->comment_ID ) &&
     592        !empty( $comment->comment_author_email )
     593    )
     594    {
     595        $options = get_option( 'gb_sf4wp_options' );
     596
     597        // if comment data is marked to be sent to SendFox after approval
     598
     599        if( get_comment_meta( $comment->comment_ID, 'sf4wp_send', TRUE ) )
     600        {
     601            if(
     602                !empty( $options['wp-comment-form'] ) &&
     603                !empty( $options['wp-comment-form']['list'] )
     604            )
     605            {
     606                $contact = array(
     607                    'email' => $comment->comment_author_email,
     608                    'lists' => array(
     609                        intval( $options['wp-comment-form']['list'] ),
     610                    ),
     611                );
     612
     613                if( !empty( $comment->comment_author ) )
     614                {
     615                    $contact['first_name'] = $comment->comment_author;
     616                }
     617
     618                $contact = apply_filters( 'sf4wp_before_add_contact', $contact, 'comment', $comment );
     619
     620                $result = gb_sf4wp_add_contact( $contact );
     621            }
     622        }
     623    }
     624}
     625add_action( 'transition_comment_status', 'gb_sf4wp_comment_approved', 10, 3 );
    561626
    562627/**
     
    10231088
    10241089/**
     1090 * Integration: Replace pluggable Divi Builder's method to
     1091 * register 3rd-party components
     1092 *
     1093 * @since 1.1.0
     1094 */
     1095
     1096if ( ! function_exists( 'et_core_get_third_party_components' ) ):
     1097
     1098function et_core_get_third_party_components( $group = '' )
     1099{
     1100    $third_party_components = apply_filters( 'et_core_get_third_party_components', array(), $group );
     1101
     1102    return $third_party_components;
     1103}
     1104
     1105endif;
     1106
     1107/**
     1108 * Integration: Add SendFox email provider to Divi Builder opt-ins
     1109 *
     1110 * @since 1.1.0
     1111 */
     1112
     1113function gb_sf4wp_add_divi_provider( $third_party_components, $group )
     1114{
     1115    if( class_exists( 'ET_Core_API_Email_Provider' ) )
     1116    {
     1117        if( $group === 'api' || $group === 'api/email' )
     1118        {
     1119            $options = get_option( 'gb_sf4wp_options' );
     1120
     1121            if( !empty( $options['divi'] ) && !empty( $options['divi']['enabled'] ) )
     1122            {
     1123                require_once plugin_dir_path( __FILE__ ) . 'includes/divi-builder/divi-email-provider.php';
     1124
     1125                $third_party_components['sendfox'] = new ET_Core_API_Email_SendFox( 'builder', 'default', '' );
     1126            }
     1127        }
     1128    }
     1129
     1130    return $third_party_components;
     1131}
     1132add_filter( 'et_core_get_third_party_components', 'gb_sf4wp_add_divi_provider', 1, 2 );
     1133
     1134/**
     1135 * Integration: Add SendFox email provider to Gutenberg Email Optin
     1136 *
     1137 * @since 1.0.0
     1138 */
     1139
     1140function gb_sf4wp_add_gutenberg_email_optin()
     1141{
     1142    if( function_exists( 'has_blocks' ) )
     1143    {
     1144        $options = get_option( 'gb_sf4wp_options' );
     1145
     1146        if( !empty( $options['gutenberg'] ) && !empty( $options['gutenberg']['enabled'] ) )
     1147        {
     1148            require_once plugin_dir_path( __FILE__ ) . 'includes/gutenberg/gutenberg-email-optin.php';
     1149        }
     1150    }
     1151}
     1152add_action( 'after_setup_theme', 'gb_sf4wp_add_gutenberg_email_optin' );
     1153
     1154/**
    10251155 * Helper: Simple logging function, useful for debugging
    10261156 *
Note: See TracChangeset for help on using the changeset viewer.