Changeset 2482736
- Timestamp:
- 02/27/2021 05:06:43 PM (5 years ago)
- Location:
- wp-phone-message/trunk
- Files:
-
- 201 added
- 1 deleted
- 18 edited
-
.gitignore (modified) (1 diff)
-
README.md (modified) (4 diffs)
-
css/admin.css (modified) (1 diff)
-
css/admin.min.css (modified) (1 diff)
-
css/shortcode.css (modified) (3 diffs)
-
css/shortcode.min.css (modified) (1 diff)
-
css/shortcodeDark.css (added)
-
css/shortcodeDark.min.css (added)
-
css/shortcodeElegant.css (added)
-
css/shortcodeElegant.min.css (added)
-
css/shortcodeSimple.css (added)
-
css/shortcodeSimple.min.css (added)
-
desktop.ini (added)
-
freemius (added)
-
freemius/LICENSE.txt (added)
-
freemius/assets (added)
-
freemius/assets/css (added)
-
freemius/assets/css/admin (added)
-
freemius/assets/css/admin/account.css (added)
-
freemius/assets/css/admin/add-ons.css (added)
-
freemius/assets/css/admin/affiliation.css (added)
-
freemius/assets/css/admin/checkout.css (added)
-
freemius/assets/css/admin/common.css (added)
-
freemius/assets/css/admin/connect.css (added)
-
freemius/assets/css/admin/debug.css (added)
-
freemius/assets/css/admin/dialog-boxes.css (added)
-
freemius/assets/css/admin/gdpr-optin-notice.css (added)
-
freemius/assets/css/admin/index.php (added)
-
freemius/assets/css/admin/plugins.css (added)
-
freemius/assets/css/customizer.css (added)
-
freemius/assets/css/index.php (added)
-
freemius/assets/img (added)
-
freemius/assets/img/index.php (added)
-
freemius/assets/img/plugin-icon.png (added)
-
freemius/assets/img/theme-icon.png (added)
-
freemius/assets/img/wp-phone-message.svg (added)
-
freemius/assets/index.php (added)
-
freemius/assets/js (added)
-
freemius/assets/js/index.php (added)
-
freemius/assets/js/nojquery.ba-postmessage.js (added)
-
freemius/assets/js/nojquery.ba-postmessage.min.js (added)
-
freemius/assets/js/postmessage.js (added)
-
freemius/config.php (added)
-
freemius/includes (added)
-
freemius/includes/class-freemius-abstract.php (added)
-
freemius/includes/class-freemius.php (added)
-
freemius/includes/class-fs-admin-notices.php (added)
-
freemius/includes/class-fs-api.php (added)
-
freemius/includes/class-fs-logger.php (added)
-
freemius/includes/class-fs-options.php (added)
-
freemius/includes/class-fs-plugin-updater.php (added)
-
freemius/includes/class-fs-security.php (added)
-
freemius/includes/class-fs-storage.php (added)
-
freemius/includes/class-fs-user-lock.php (added)
-
freemius/includes/customizer (added)
-
freemius/includes/customizer/class-fs-customizer-support-section.php (added)
-
freemius/includes/customizer/class-fs-customizer-upsell-control.php (added)
-
freemius/includes/customizer/index.php (added)
-
freemius/includes/debug (added)
-
freemius/includes/debug/class-fs-debug-bar-panel.php (added)
-
freemius/includes/debug/debug-bar-start.php (added)
-
freemius/includes/debug/index.php (added)
-
freemius/includes/entities (added)
-
freemius/includes/entities/class-fs-affiliate-terms.php (added)
-
freemius/includes/entities/class-fs-affiliate.php (added)
-
freemius/includes/entities/class-fs-billing.php (added)
-
freemius/includes/entities/class-fs-entity.php (added)
-
freemius/includes/entities/class-fs-payment.php (added)
-
freemius/includes/entities/class-fs-plugin-info.php (added)
-
freemius/includes/entities/class-fs-plugin-license.php (added)
-
freemius/includes/entities/class-fs-plugin-plan.php (added)
-
freemius/includes/entities/class-fs-plugin-tag.php (added)
-
freemius/includes/entities/class-fs-plugin.php (added)
-
freemius/includes/entities/class-fs-pricing.php (added)
-
freemius/includes/entities/class-fs-scope-entity.php (added)
-
freemius/includes/entities/class-fs-site.php (added)
-
freemius/includes/entities/class-fs-subscription.php (added)
-
freemius/includes/entities/class-fs-user.php (added)
-
freemius/includes/entities/index.php (added)
-
freemius/includes/fs-core-functions.php (added)
-
freemius/includes/fs-essential-functions.php (added)
-
freemius/includes/fs-plugin-info-dialog.php (added)
-
freemius/includes/i18n.php (added)
-
freemius/includes/index.php (added)
-
freemius/includes/l10n.php (added)
-
freemius/includes/managers (added)
-
freemius/includes/managers/class-fs-admin-menu-manager.php (added)
-
freemius/includes/managers/class-fs-admin-notice-manager.php (added)
-
freemius/includes/managers/class-fs-cache-manager.php (added)
-
freemius/includes/managers/class-fs-gdpr-manager.php (added)
-
freemius/includes/managers/class-fs-key-value-storage.php (added)
-
freemius/includes/managers/class-fs-license-manager.php (added)
-
freemius/includes/managers/class-fs-option-manager.php (added)
-
freemius/includes/managers/class-fs-plan-manager.php (added)
-
freemius/includes/managers/class-fs-plugin-manager.php (added)
-
freemius/includes/managers/index.php (added)
-
freemius/includes/sdk (added)
-
freemius/includes/sdk/Exceptions (added)
-
freemius/includes/sdk/Exceptions/ArgumentNotExistException.php (added)
-
freemius/includes/sdk/Exceptions/EmptyArgumentException.php (added)
-
freemius/includes/sdk/Exceptions/Exception.php (added)
-
freemius/includes/sdk/Exceptions/InvalidArgumentException.php (added)
-
freemius/includes/sdk/Exceptions/OAuthException.php (added)
-
freemius/includes/sdk/Exceptions/index.php (added)
-
freemius/includes/sdk/FreemiusBase.php (added)
-
freemius/includes/sdk/FreemiusWordPress.php (added)
-
freemius/includes/sdk/LICENSE.txt (added)
-
freemius/includes/sdk/index.php (added)
-
freemius/includes/supplements (added)
-
freemius/includes/supplements/fs-essential-functions-1.1.7.1.php (added)
-
freemius/includes/supplements/fs-essential-functions-2.2.1.php (added)
-
freemius/includes/supplements/index.php (added)
-
freemius/index.php (added)
-
freemius/languages (added)
-
freemius/languages/freemius-cs_CZ.mo (added)
-
freemius/languages/freemius-da_DK.mo (added)
-
freemius/languages/freemius-en.mo (added)
-
freemius/languages/freemius-es_ES.mo (added)
-
freemius/languages/freemius-fr_FR.mo (added)
-
freemius/languages/freemius-he_IL.mo (added)
-
freemius/languages/freemius-hu_HU.mo (added)
-
freemius/languages/freemius-it_IT.mo (added)
-
freemius/languages/freemius-ja.mo (added)
-
freemius/languages/freemius-nl_NL.mo (added)
-
freemius/languages/freemius-ru_RU.mo (added)
-
freemius/languages/freemius-ta.mo (added)
-
freemius/languages/freemius-zh_CN.mo (added)
-
freemius/languages/freemius.pot (added)
-
freemius/languages/index.php (added)
-
freemius/require.php (added)
-
freemius/start.php (added)
-
freemius/templates (added)
-
freemius/templates/account (added)
-
freemius/templates/account.php (added)
-
freemius/templates/account/billing.php (added)
-
freemius/templates/account/index.php (added)
-
freemius/templates/account/partials (added)
-
freemius/templates/account/partials/activate-license-button.php (added)
-
freemius/templates/account/partials/addon.php (added)
-
freemius/templates/account/partials/deactivate-license-button.php (added)
-
freemius/templates/account/partials/index.php (added)
-
freemius/templates/account/partials/site.php (added)
-
freemius/templates/account/payments.php (added)
-
freemius/templates/add-ons.php (added)
-
freemius/templates/add-trial-to-pricing.php (added)
-
freemius/templates/admin-notice.php (added)
-
freemius/templates/ajax-loader.php (added)
-
freemius/templates/auto-installation.php (added)
-
freemius/templates/checkout.php (added)
-
freemius/templates/connect.php (added)
-
freemius/templates/contact.php (added)
-
freemius/templates/debug (added)
-
freemius/templates/debug.php (added)
-
freemius/templates/debug/api-calls.php (added)
-
freemius/templates/debug/index.php (added)
-
freemius/templates/debug/logger.php (added)
-
freemius/templates/debug/plugins-themes-sync.php (added)
-
freemius/templates/debug/scheduled-crons.php (added)
-
freemius/templates/email.php (added)
-
freemius/templates/firewall-issues-js.php (added)
-
freemius/templates/forms (added)
-
freemius/templates/forms/affiliation.php (added)
-
freemius/templates/forms/data-debug-mode.php (added)
-
freemius/templates/forms/deactivation (added)
-
freemius/templates/forms/deactivation/contact.php (added)
-
freemius/templates/forms/deactivation/form.php (added)
-
freemius/templates/forms/deactivation/index.php (added)
-
freemius/templates/forms/deactivation/retry-skip.php (added)
-
freemius/templates/forms/index.php (added)
-
freemius/templates/forms/license-activation.php (added)
-
freemius/templates/forms/optout.php (added)
-
freemius/templates/forms/premium-versions-upgrade-handler.php (added)
-
freemius/templates/forms/premium-versions-upgrade-metadata.php (added)
-
freemius/templates/forms/resend-key.php (added)
-
freemius/templates/forms/subscription-cancellation.php (added)
-
freemius/templates/forms/trial-start.php (added)
-
freemius/templates/forms/user-change.php (added)
-
freemius/templates/gdpr-optin-js.php (added)
-
freemius/templates/index.php (added)
-
freemius/templates/js (added)
-
freemius/templates/js/index.php (added)
-
freemius/templates/js/jquery.content-change.php (added)
-
freemius/templates/js/open-license-activation.php (added)
-
freemius/templates/js/style-premium-theme.php (added)
-
freemius/templates/partials (added)
-
freemius/templates/partials/index.php (added)
-
freemius/templates/partials/network-activation.php (added)
-
freemius/templates/plugin-icon.php (added)
-
freemius/templates/plugin-info (added)
-
freemius/templates/plugin-info/description.php (added)
-
freemius/templates/plugin-info/features.php (added)
-
freemius/templates/plugin-info/index.php (added)
-
freemius/templates/plugin-info/screenshots.php (added)
-
freemius/templates/powered-by.php (added)
-
freemius/templates/pricing.php (added)
-
freemius/templates/secure-https-header.php (added)
-
freemius/templates/sticky-admin-notice-js.php (added)
-
freemius/templates/tabs-capture-js.php (added)
-
freemius/templates/tabs.php (added)
-
includes/WpPhoneMessageAdmin.php (modified) (4 diffs)
-
includes/WpPhoneMessageForm.php (added)
-
includes/WpPhoneMessageFrontend.php (added)
-
includes/WpPhoneMessageModel.php (modified) (2 diffs)
-
includes/WpPhoneMessageShortcode.php (modified) (2 diffs)
-
includes/WpPhoneMessageWidget.php (modified) (2 diffs)
-
includes/deletePlugin.php (added)
-
includes/freemius.php (added)
-
js/admin.js (modified) (1 diff)
-
js/admin.min.js (modified) (1 diff)
-
js/shortcode.js (modified) (3 diffs)
-
js/shortcode.min.js (modified) (1 diff)
-
readme.txt (modified) (8 diffs)
-
uninstall.php (deleted)
-
views/admin-form-settings.php (added)
-
views/admin-form-shortcode.php (added)
-
views/admin-form-style.php (added)
-
views/admin-form-widget.php (added)
-
views/shortcode-form.php (modified) (1 diff)
-
views/widget-form.php (modified) (1 diff)
-
wp-phone-message.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-phone-message/trunk/.gitignore
r2248677 r2482736 22 22 *.sql 23 23 *.sqlite 24 25 # don't track custom styles 26 css/custom_user.css -
wp-phone-message/trunk/README.md
r2333369 r2482736 13 13 * Enter form bottom text 14 14 * Possibility to add name field in shortcode form 15 * Possibility to add addressfield in shortcode form15 * Possibility to add extra field in shortcode form 16 16 * Possibility to add phone number field in shortcode form 17 17 * Possibility to add email address field in shortcode form 18 18 * Possibility to add name field in widget form 19 * Possibility to add addressfield in widget form19 * Possibility to add extra field in widget form 20 20 * Possibility to add phone number field in widget form 21 21 * Possibility to add email address field in widget form … … 27 27 * Enter form text 28 28 * Possibility to add name field 29 * Possibility to add addressfield29 * Possibility to add extra field 30 30 * Possibility to add phone number field 31 31 * Possibility to add email address field … … 74 74 To add an international contact's phone number: 75 75 76 * Open your phone's addressbook.76 * Open your phone's extra book. 77 77 * When adding the contact's phone number, start by entering a plus sign (+). 78 78 * Enter the country code, followed by the full phone number. … … 82 82 Note: 83 83 * Make sure to remove any leading 0s or special calling codes. 84 * If you meant to add a local (in country) phone number to your phone's addressbook, enter the number as if you were calling your contact on the phone.84 * If you meant to add a local (in country) phone number to your phone's extra book, enter the number as if you were calling your contact on the phone. 85 85 * All phone numbers in Argentina (country code "54") should have a "9" between the country code and area code. The prefix "15" must be removed so the final number will have 13 digits total: +54 9 XXX XXX XXXX 86 86 * Phone numbers in Mexico (country code "52") need to have "1" after "+52", even if they're Nextel numbers. -
wp-phone-message/trunk/css/admin.css
r2248677 r2482736 1 . form-messages {1 .wp-phone-message-form .form-messages { 2 2 text-align: left; 3 3 font-weight: 600; 4 color: red ;4 color: red !important; 5 5 } 6 6 .wp-phone-message-form .form-description, .wp-phone-message-form .admin-page-title{ 7 padding-top: 20px; 8 } 7 9 /* insert flags */ 8 10 -
wp-phone-message/trunk/css/admin.min.css
r2254582 r2482736 1 . form-messages{text-align:left;font-weight:600;color:red}.iti__flag{background-image:url(../js/intl-tel-input/build/img/flags.png)}@media (-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){.iti__flag{background-image:url(../js/intl-tel-input/build/img/flags@2x.png)}}1 .wp-phone-message-form .form-messages{text-align:left;font-weight:600;color:red!important}.wp-phone-message-form .admin-page-title,.wp-phone-message-form .form-description{padding-top:20px}.iti__flag{background-image:url(../js/intl-tel-input/build/img/flags.png)}@media (-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){.iti__flag{background-image:url(../js/intl-tel-input/build/img/flags@2x.png)}} -
wp-phone-message/trunk/css/shortcode.css
r2298356 r2482736 23 23 .whatapp-form .wp-phone-message-name, 24 24 .whatapp-form .wp-phone-message-phone, 25 .whatapp-form .wp-phone-message-address, 26 .whatapp-form .wp-phone-message-email { 27 background: rgba(255,255,255,.1); 25 .whatapp-form .wp-phone-message-extra, 26 .whatapp-form .wp-phone-message-email, 27 .whatapp-form .wp-phone-message-dropdown { 28 background: rgba(247, 247, 247, 0.1); 28 29 border: none; 29 30 border-radius: 4px; … … 38 39 -moz-box-sizing: border-box; 39 40 background-color: #e8eeef; 40 color: # 8a97a0;41 color: #0e101a; 41 42 -webkit-box-shadow: 0 1px 0 rgba(0,0,0,0.03) inset; 42 43 box-shadow: 0 1px 0 rgba(0,0,0,0.03) inset; 44 } 45 .whatapp-form .wp-phone-message-message::placeholder, 46 .whatapp-form .wp-phone-message-name::placeholder, 47 .whatapp-form .wp-phone-message-phone::placeholder, 48 .whatapp-form .wp-phone-message-extra::placeholder, 49 .whatapp-form .wp-phone-message-email::placeholder, 50 .whatapp-form .wp-phone-message-dropdown::placeholder { 51 color: #0e101a; 52 opacity: 0.6; 43 53 } 44 54 .whatapp-form .wp-phone-message-message { … … 48 58 .whatapp-form .wp-phone-message-name:focus, 49 59 .whatapp-form .wp-phone-message-phone:focus, 50 .whatapp-form .wp-phone-message-address:focus, 51 .whatapp-form .wp-phone-message-email:focus { 60 .whatapp-form .wp-phone-message-extra:focus, 61 .whatapp-form .wp-phone-message-email:focus, 62 .whatapp-form .wp-phone-message-dropdown:focus { 52 63 background: #d2d9dd; 53 64 } -
wp-phone-message/trunk/css/shortcode.min.css
r2298356 r2482736 1 .whatapp-wrapper{background:#f4f7f8;border:1px solid #efefef;border-radius:8px;width:100%;margin:0 0 40px}.whatapp-form{max-width:500px;margin:10px auto;padding:20px 10px;text-align:center}.whatapp-form .whatapp-text{margin:10px 0;font-size:15px}.whatapp-form .whatapp-title{font-size:25px;margin:10px!important}.whatapp-form .wp-phone-message- address,.whatapp-form .wp-phone-message-email,.whatapp-form .wp-phone-message-message,.whatapp-form .wp-phone-message-name,.whatapp-form .wp-phone-message-phone{background:rgba(255,255,255,.1);border:none;border-radius:4px;font-size:15px;margin:10px 0 0;outline:0;padding:10px;max-width:100%;width:100%;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;background-color:#e8eeef;color:#8a97a0;-webkit-box-shadow:0 1px 0 rgba(0,0,0,.03) inset;box-shadow:0 1px 0 rgba(0,0,0,.03) inset}.whatapp-form .wp-phone-message-message{height:100px}.whatapp-form .wp-phone-message-address:focus,.whatapp-form .wp-phone-message-email:focus,.whatapp-form .wp-phone-message-message:focus,.whatapp-form .wp-phone-message-name:focus,.whatapp-form .wp-phone-message-phone:focus{background:#d2d9dd}.whatapp-form .whatapp-error{color:red;font-size:14px}.whatapp-form .wp-phone-message-button{position:relative;display:block;padding:12px 20px 12px 20px;color:#fff;margin:10px auto;background:#1abc9c;font-size:18px;text-align:center;font-style:normal;width:100%;border:1px solid #16a085;border-width:1px 1px 3px}.whatapp-form .wp-phone-message-button:hover{background:#109177}1 .whatapp-wrapper{background:#f4f7f8;border:1px solid #efefef;border-radius:8px;width:100%;margin:0 0 40px}.whatapp-form{max-width:500px;margin:10px auto;padding:20px 10px;text-align:center}.whatapp-form .whatapp-text{margin:10px 0;font-size:15px}.whatapp-form .whatapp-title{font-size:25px;margin:10px!important}.whatapp-form .wp-phone-message-dropdown,.whatapp-form .wp-phone-message-email,.whatapp-form .wp-phone-message-extra,.whatapp-form .wp-phone-message-message,.whatapp-form .wp-phone-message-name,.whatapp-form .wp-phone-message-phone{background:rgba(247,247,247,.1);border:none;border-radius:4px;font-size:15px;margin:10px 0 0;outline:0;padding:10px;max-width:100%;width:100%;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;background-color:#e8eeef;color:#0e101a;-webkit-box-shadow:0 1px 0 rgba(0,0,0,.03) inset;box-shadow:0 1px 0 rgba(0,0,0,.03) inset}.whatapp-form .wp-phone-message-dropdown::placeholder,.whatapp-form .wp-phone-message-email::placeholder,.whatapp-form .wp-phone-message-extra::placeholder,.whatapp-form .wp-phone-message-message::placeholder,.whatapp-form .wp-phone-message-name::placeholder,.whatapp-form .wp-phone-message-phone::placeholder{color:#0e101a;opacity:.6}.whatapp-form .wp-phone-message-message{height:100px}.whatapp-form .wp-phone-message-dropdown:focus,.whatapp-form .wp-phone-message-email:focus,.whatapp-form .wp-phone-message-extra:focus,.whatapp-form .wp-phone-message-message:focus,.whatapp-form .wp-phone-message-name:focus,.whatapp-form .wp-phone-message-phone:focus{background:#d2d9dd}.whatapp-form .whatapp-error{color:red;font-size:14px}.whatapp-form .wp-phone-message-button{position:relative;display:block;padding:12px 20px 12px 20px;color:#fff;margin:10px auto;background:#1abc9c;font-size:18px;text-align:center;font-style:normal;width:100%;border:1px solid #16a085;border-width:1px 1px 3px}.whatapp-form .wp-phone-message-button:hover{background:#109177} -
wp-phone-message/trunk/includes/WpPhoneMessageAdmin.php
r2415319 r2482736 8 8 public function __construct(){ 9 9 add_action( 'admin_menu', array( $this, 'adminMenu' ) ); 10 add_action( 'admin_post', array( $this, 'adminSave' ) ); 10 add_action( 'admin_post_wp-phone-message-settings', array( $this, 'adminSettingSave' ) ); 11 add_action( 'admin_post_wp-phone-message-shortcode', array( $this, 'adminShortcodeSave' ) ); 12 add_action( 'admin_post_wp-phone-message-widget', array( $this, 'adminWidgetSave' ) ); 13 add_action( 'admin_post_wp-phone-message-style', array( $this, 'adminStyleSave' ) ); 14 11 15 add_action( 'admin_enqueue_scripts', array( $this, 'adminStyle' ) ); 12 16 $this->model = new WpPhoneMessageModel; … … 15 19 public function adminMenu() { 16 20 add_options_page( 17 'WP Phone Message Settings',18 'WP Phone Message',21 __('WP Phone Message Settings', 'wp-phone-message'), 22 __('WP Phone Message', 'wp-phone-message'), 19 23 'manage_options', 20 24 'wp-phone-message-admin', … … 26 30 public function adminPage() { 27 31 //show the form 28 include_once( PLUGIN_WPM_PATH . 'views/admin-form.php' ); 32 if( isset( $_GET[ 'tab' ] ) ) { 33 $active_tab = $_GET[ 'tab' ]; 34 } else { 35 $active_tab = 'general_settings'; 36 } 37 38 switch($active_tab){ 39 case 'general_settings': include_once( PLUGIN_WPM_PATH . 'views/admin-form-settings.php' ); 40 break; 41 case 'shortcode_form': include_once( PLUGIN_WPM_PATH . 'views/admin-form-shortcode.php' ); 42 break; 43 case 'widget_form': include_once( PLUGIN_WPM_PATH . 'views/admin-form-widget.php' ); 44 break; 45 case 'style': include_once( PLUGIN_WPM_PATH . 'views/admin-form-style.php' ); 46 break; 47 default: include_once( PLUGIN_WPM_PATH . 'views/admin-form-settings.php' ); 48 } 29 49 } 30 50 31 public function adminS ave(){51 public function adminSettingSave(){ 32 52 // save data 33 53 if( ( $_POST['wp-phone-message-phone-number'] ) && ( $_POST['wp-phone-message-phone-prefix'] ) ) { 34 54 $_POST['wp-phone-message-phone-number'] = $this->cleanPhoneNumber($_POST); 35 $this->model->set Data($_POST);55 $this->model->setSettingsData($_POST); 36 56 $this->model->setMessage('Settings saved.'); 37 57 } 38 58 else{ 39 $this->model->set Data($_POST);40 $this->model->setMessage('International prefix and Whats app phone number are required.');59 $this->model->setSettingsData($_POST); 60 $this->model->setMessage('International prefix and WhatsApp phone number are required.'); 41 61 } 62 63 $this->adminRedirect(); 64 } 65 66 public function adminShortcodeSave(){ 67 $this->model->setShortcodeData($_POST); 68 69 $this->adminRedirect(); 70 } 71 72 public function adminWidgetSave(){ 73 $this->model->setWidgetData($_POST); 74 75 $this->adminRedirect(); 76 } 77 78 public function adminStyleSave(){ 79 $this->model->setStyleData($_POST); 42 80 43 81 $this->adminRedirect(); … … 66 104 wp_enqueue_style('wp-phone-message-admin', PLUGIN_WPM_URL . 'css/admin.min.css', array(), null, 'all' ); 67 105 wp_enqueue_script('wp-phone-message-admin', PLUGIN_WPM_URL . 'js/admin.min.js', array( 'jquery' ), '1.0.0', true ); 106 107 // use CodeMirror for CSS in style page 108 $cm_settings['codeEditor'] = wp_enqueue_code_editor( 109 array( 110 'type' => 'text/css', 111 'plugin' => 'wp-phone-message' 112 )); 113 wp_localize_script('jquery', 'cm_settings', $cm_settings); 114 115 wp_enqueue_script('wp-theme-plugin-editor'); 116 wp_enqueue_style('wp-codemirror'); 68 117 } 69 118 -
wp-phone-message/trunk/includes/WpPhoneMessageModel.php
r2447492 r2482736 1 1 <?php 2 2 3 if ( !class_exists( 'WpPhoneMessageModel' ) ) { 3 4 class WpPhoneMessageModel { 5 6 public function setData($args){ 7 4 class WpPhoneMessageModel 5 { 6 public function setSettingsData( $args ) 7 { 8 8 $phone = sanitize_text_field( $args['wp-phone-message-phone-number'] ); 9 $prefix = (int) str_replace( ' ', '', sanitize_text_field( $args['wp-phone-message-phone-prefix'] ));9 $prefix = (int) str_replace( ' ', '', sanitize_text_field( $args['wp-phone-message-phone-prefix'] ) ); 10 10 $title = sanitize_text_field( $args['wp-phone-message-title'] ); 11 $text = sanitize_text_field( $args['wp-phone-message-text'] ); 12 $button = sanitize_text_field( $args['wp-phone-message-button'] ); 13 $textarea = sanitize_text_field( $args['wp-phone-message-textarea'] ); 14 $name_place = sanitize_text_field( $args['wp-phone-message-name'] ); 15 $name_active = sanitize_text_field( $args['wp-phone-message-name-active'] ); 16 $name_active_widget = sanitize_text_field( $args['wp-phone-message-name-active-widget'] ); 17 $name_mandatory = sanitize_text_field( $args['wp-phone-message-name-mandatory'] ); 18 $address_place = sanitize_text_field( $args['wp-phone-message-address'] ); 19 $address_active = sanitize_text_field( $args['wp-phone-message-address-active'] ); 20 $address_active_widget = sanitize_text_field( $args['wp-phone-message-address-active-widget'] ); 21 $address_mandatory = sanitize_text_field( $args['wp-phone-message-address-mandatory'] ); 22 $phone_place = sanitize_text_field( $args['wp-phone-message-phone'] ); 23 $phone_active = sanitize_text_field( $args['wp-phone-message-phone-active'] ); 24 $phone_active_widget = sanitize_text_field( $args['wp-phone-message-phone-active-widget'] ); 25 $phone_mandatory = sanitize_text_field( $args['wp-phone-message-phone-mandatory'] ); 26 $email_place = sanitize_text_field( $args['wp-phone-message-email'] ); 27 $email_active = sanitize_text_field( $args['wp-phone-message-email-active'] ); 28 $email_active_widget = sanitize_text_field( $args['wp-phone-message-email-active-widget'] ); 29 $email_mandatory = sanitize_text_field( $args['wp-phone-message-email-mandatory'] ); 30 31 $fullPhoneNumber = (int) str_replace(' ', '', $prefix) . ltrim(str_replace(' ', '', $phone), '0') ; 32 11 $fullPhoneNumber = (int) str_replace( ' ', '', $prefix ) . ltrim( str_replace( ' ', '', $phone ), '0' ); 33 12 update_option( 'wp-phone-message-phone-number', $phone ); 34 13 update_option( 'wp-phone-message-phone-prefix', $prefix ); 35 14 update_option( 'wp-phone-message-full-phone-number', $fullPhoneNumber ); 36 15 update_option( 'wp-phone-message-title', $title ); 16 } 17 18 public function setShortcodeData( $args ) 19 { 20 // Shortcode Form Fields 21 $text = sanitize_text_field( $args['wp-phone-message-text'] ); 22 $button = sanitize_text_field( $args['wp-phone-message-button'] ); 23 $name_place = sanitize_text_field( $args['wp-phone-message-name'] ); 24 $name_active = sanitize_text_field( $args['wp-phone-message-name-active'] ); 25 $name_mandatory = sanitize_text_field( $args['wp-phone-message-name-mandatory'] ); 26 $extra_place = sanitize_text_field( $args['wp-phone-message-extra'] ); 27 $extra_active = sanitize_text_field( $args['wp-phone-message-extra-active'] ); 28 $extra_mandatory = sanitize_text_field( $args['wp-phone-message-extra-mandatory'] ); 29 $phone_place = sanitize_text_field( $args['wp-phone-message-phone'] ); 30 $phone_active = sanitize_text_field( $args['wp-phone-message-phone-active'] ); 31 $phone_mandatory = sanitize_text_field( $args['wp-phone-message-phone-mandatory'] ); 32 $email_place = sanitize_text_field( $args['wp-phone-message-email'] ); 33 $email_active = sanitize_text_field( $args['wp-phone-message-email-active'] ); 34 $email_mandatory = sanitize_text_field( $args['wp-phone-message-email-mandatory'] ); 35 $dropdown_place = sanitize_text_field( $args['wp-phone-message-dropdown'] ); 36 $dropdown_active = sanitize_text_field( $args['wp-phone-message-dropdown-active'] ); 37 $dropdown_mandatory = sanitize_text_field( $args['wp-phone-message-dropdown-mandatory'] ); 38 $textarea = ''; 39 // Shortcode Form Fields 37 40 update_option( 'wp-phone-message-text', $text ); 38 41 update_option( 'wp-phone-message-button', $button ); … … 40 43 update_option( 'wp-phone-message-name', $name_place ); 41 44 update_option( 'wp-phone-message-name-active', $name_active ); 42 update_option( 'wp-phone-message-name-active-widget', $name_active_widget );43 45 update_option( 'wp-phone-message-name-mandatory', $name_mandatory ); 44 update_option( 'wp-phone-message-address', $address_place ); 45 update_option( 'wp-phone-message-address-active', $address_active ); 46 update_option( 'wp-phone-message-address-active-widget', $address_active_widget ); 47 update_option( 'wp-phone-message-address-mandatory', $address_mandatory ); 46 update_option( 'wp-phone-message-extra', $extra_place ); 47 update_option( 'wp-phone-message-extra-active', $extra_active ); 48 update_option( 'wp-phone-message-extra-mandatory', $extra_mandatory ); 48 49 update_option( 'wp-phone-message-phone', $phone_place ); 49 50 update_option( 'wp-phone-message-phone-active', $phone_active ); 50 update_option( 'wp-phone-message-phone-active-widget', $phone_active_widget );51 51 update_option( 'wp-phone-message-phone-mandatory', $phone_mandatory ); 52 52 update_option( 'wp-phone-message-email', $email_place ); 53 53 update_option( 'wp-phone-message-email-active', $email_active ); 54 update_option( 'wp-phone-message-email-mandatory', $email_mandatory ); 55 update_option( 'wp-phone-message-dropdown', $dropdown_place ); 56 update_option( 'wp-phone-message-dropdown-active', $dropdown_active ); 57 update_option( 'wp-phone-message-dropdown-mandatory', $dropdown_mandatory ); 58 } 59 60 public function setWidgetData( $args ) 61 { 62 // widget form fields 63 $button_widget = sanitize_text_field( $args['wp-phone-message-button-widget'] ); 64 $name_place_widget = sanitize_text_field( $args['wp-phone-message-name-widget'] ); 65 $name_active_widget = sanitize_text_field( $args['wp-phone-message-name-active-widget'] ); 66 $name_mandatory_widget = sanitize_text_field( $args['wp-phone-message-name-mandatory-widget'] ); 67 $extra_place_widget = sanitize_text_field( $args['wp-phone-message-extra-widget'] ); 68 $extra_active_widget = sanitize_text_field( $args['wp-phone-message-extra-active-widget'] ); 69 $extra_mandatory_widget = sanitize_text_field( $args['wp-phone-message-extra-mandatory-widget'] ); 70 $phone_place_widget = sanitize_text_field( $args['wp-phone-message-phone-widget'] ); 71 $phone_active_widget = sanitize_text_field( $args['wp-phone-message-phone-active-widget'] ); 72 $phone_mandatory_widget = sanitize_text_field( $args['wp-phone-message-phone-mandatory-widget'] ); 73 $email_place_widget = sanitize_text_field( $args['wp-phone-message-email-widget'] ); 74 $email_active_widget = sanitize_text_field( $args['wp-phone-message-email-active-widget'] ); 75 $email_mandatory_widget = sanitize_text_field( $args['wp-phone-message-email-mandatory-widget'] ); 76 $dropdown_place_widget = sanitize_text_field( $args['wp-phone-message-dropdown-widget'] ); 77 $dropdown_active_widget = sanitize_text_field( $args['wp-phone-message-dropdown-active-widget'] ); 78 $dropdown_mandatory_widget = sanitize_text_field( $args['wp-phone-message-dropdown-mandatory-widget'] ); 79 $textarea_widget = ''; 80 // widget form fields 81 update_option( 'wp-phone-message-button-widget', $button_widget ); 82 update_option( 'wp-phone-message-textarea-widget', $textarea_widget ); 83 update_option( 'wp-phone-message-name-widget', $name_place_widget ); 84 update_option( 'wp-phone-message-name-active-widget', $name_active_widget ); 85 update_option( 'wp-phone-message-name-mandatory-widget', $name_mandatory_widget ); 86 update_option( 'wp-phone-message-extra-widget', $extra_place_widget ); 87 update_option( 'wp-phone-message-extra-active-widget', $extra_active_widget ); 88 update_option( 'wp-phone-message-extra-mandatory-widget', $extra_mandatory_widget ); 89 update_option( 'wp-phone-message-phone-widget', $phone_place_widget ); 90 update_option( 'wp-phone-message-phone-active-widget', $phone_active_widget ); 91 update_option( 'wp-phone-message-phone-mandatory-widget', $phone_mandatory_widget ); 92 update_option( 'wp-phone-message-email-widget', $email_place_widget ); 54 93 update_option( 'wp-phone-message-email-active-widget', $email_active_widget ); 55 update_option( 'wp-phone-message-email-mandatory', $email_mandatory ); 56 94 update_option( 'wp-phone-message-email-mandatory-widget', $email_mandatory_widget ); 95 update_option( 'wp-phone-message-dropdown-widget', $dropdown_place_widget ); 96 update_option( 'wp-phone-message-dropdown-active-widget', $dropdown_active_widget ); 97 update_option( 'wp-phone-message-dropdown-mandatory-widget', $dropdown_mandatory_widget ); 57 98 } 58 59 public function setMessage($message){ 60 update_option( 'wp-phone-message-form-message', $message); 99 100 public function setStyleData( $args ) 101 { 102 $css = ''; 103 $style = ''; 104 update_option( 'wp-phone-message-css', $css ); 105 update_option( 'wp-phone-message-style', $style ); 61 106 } 62 63 public function getFullPhoneNumber(){ 107 108 public function setMessage( $message ) 109 { 110 update_option( 'wp-phone-message-form-message', $message ); 111 } 112 113 public function getFullPhoneNumber() 114 { 64 115 return get_option( 'wp-phone-message-full-phone-number' ); 65 116 } 117 66 118 } 67 119 } -
wp-phone-message/trunk/includes/WpPhoneMessageShortcode.php
r2447492 r2482736 4 4 class WpPhoneMessageShortcode { 5 5 6 private $pluginModel;7 8 6 public function __construct(){ 9 7 add_action( 'init', array( $this, 'registerShortcode' )); 10 add_action( 'wp_enqueue_scripts', array( $this, 'shortcodeStyle' ) );11 12 $this->pluginModel = new WpPhoneMessageModel;13 8 } 14 9 … … 21 16 return $shortcode_form; 22 17 } 23 24 public function shortcodeStyle(){25 wp_enqueue_style('wp-phone-message-shortcode', PLUGIN_WPM_URL . 'css/shortcode.min.css', array(), null, 'all' );26 wp_enqueue_script('wp-phone-message-shortcode', PLUGIN_WPM_URL . 'js/shortcode.min.js', array( 'jquery' ), '1.0.0', true );27 wp_localize_script( 'wp-phone-message-shortcode', 'wp_phone_message_data',28 array(29 'fullPhoneNumber' => $this->pluginModel->getFullPhoneNumber() ,30 )31 );32 }33 18 } 34 19 } -
wp-phone-message/trunk/includes/WpPhoneMessageWidget.php
r2248677 r2482736 12 12 13 13 // Widget name will appear in UI 14 __('WP Phone Message Widget', 'wp _phone_message_domain'),14 __('WP Phone Message Widget', 'wp-phone-message'), 15 15 16 16 // Widget description 17 array( 'description' => __( 'Display Whatsapp message form on widget', 'wp _phone_message_domain' ), )17 array( 'description' => __( 'Display Whatsapp message form on widget', 'wp-phone-message' ), ) 18 18 ); 19 19 } … … 42 42 } 43 43 else { 44 $title = __( 'New title', 'wp _phone_message_domain' );44 $title = __( 'New title', 'wp-phone-message' ); 45 45 } 46 46 if ( isset( $instance[ 'text' ] ) ) { -
wp-phone-message/trunk/js/admin.js
r2248677 r2482736 15 15 }); 16 16 } 17 18 wp.codeEditor.initialize(jQuery('#wp-phone-message-css'), cm_settings); 19 17 20 }); -
wp-phone-message/trunk/js/admin.min.js
r2254582 r2482736 1 jQuery(document).ready((function(){var input=document.querySelector("#wp-phone-message-phone-prefix");if(null!==input){window.intlTelInput(input);var currentPrefix=jQuery("#wp-phone-message-phone-prefix").val(),currentFlag,currentCode=jQuery('.iti__country[data-dial-code="'+currentPrefix+'"]').attr("data-country-code");jQuery(".iti__flag:first").addClass(" iti__"+currentCode),jQuery(".iti__country").click((function(){var thisPrefix=jQuery(this).attr("data-dial-code");jQuery("#wp-phone-message-phone-prefix").val(thisPrefix)}))} }));1 jQuery(document).ready((function(){var input=document.querySelector("#wp-phone-message-phone-prefix");if(null!==input){window.intlTelInput(input);var currentPrefix=jQuery("#wp-phone-message-phone-prefix").val(),currentFlag,currentCode=jQuery('.iti__country[data-dial-code="'+currentPrefix+'"]').attr("data-country-code");jQuery(".iti__flag:first").addClass(" iti__"+currentCode),jQuery(".iti__country").click((function(){var thisPrefix=jQuery(this).attr("data-dial-code");jQuery("#wp-phone-message-phone-prefix").val(thisPrefix)}))}wp.codeEditor.initialize(jQuery("#wp-phone-message-css"),cm_settings)})); -
wp-phone-message/trunk/js/shortcode.js
r2447492 r2482736 7 7 var message = $('#wp-phone-message-message').val(); 8 8 var name = $('#wp-phone-message-name').val(); 9 var address = $('#wp-phone-message-address').val();9 var extra = $('#wp-phone-message-extra').val(); 10 10 var phone = $('#wp-phone-message-phone').val(); 11 11 var email = $('#wp-phone-message-email').val(); 12 var dropdown = $('#wp-phone-message-dropdown').val(); 12 13 var title = $('#wp-phone-message-title').val(); 13 14 14 15 if (whatappValidation(fullTelephone, 'whatapp-error')) { 15 final_message = whatappCreateFinalMessage(name, address, phone, email, message);16 final_message = whatappCreateFinalMessage(name, extra, phone, email, message, dropdown); 16 17 var whatappUrl = "https://wa.me/" + fullTelephone + "?text=" + final_message; 17 18 … … 25 26 var message = $('#wp-phone-message-widget-message').val(); 26 27 var name = $('#wp-phone-message-widget-name').val(); 27 var address = $('#wp-phone-message-widget-address').val();28 var extra = $('#wp-phone-message-widget-extra').val(); 28 29 var phone = $('#wp-phone-message-widget-phone').val(); 29 30 var email = $('#wp-phone-message-widget-email').val(); 31 var dropdown = $('#wp-phone-message-widget-dropdown').val(); 30 32 31 33 if (whatappValidation(fullTelephone, 'whatapp-widget-error')) { 32 final_message = whatappCreateFinalMessage(name, address, phone, email, message);34 final_message = whatappCreateFinalMessage(name, extra, phone, email, message, dropdown); 33 35 var whatappUrl = "https://wa.me/" + fullTelephone + "?text=" + final_message; 34 36 … … 59 61 } 60 62 61 function whatappCreateFinalMessage(name, address, phone, email, message) {63 function whatappCreateFinalMessage(name, extra, phone, email, message, dropdown) { 62 64 63 65 final_message = ''; 64 66 if (name !== undefined) 65 67 final_message += name + ' %0a'; 66 if ( address!== undefined)67 final_message += address+ ' %0a';68 if (extra !== undefined) 69 final_message += extra + ' %0a'; 68 70 if (phone !== undefined) 69 71 final_message += phone + ' %0a'; 70 72 if (email !== undefined) 71 73 final_message += email + ' %0a'; 74 if (dropdown !== undefined) 75 final_message += dropdown + ' %0a'; 76 72 77 final_message += message.replace(/[\r\n]/g, " %0a"); 73 78 -
wp-phone-message/trunk/js/shortcode.min.js
r2447492 r2482736 1 jQuery(document).ready((function($){var fullTelephone=wp_phone_message_data.fullPhoneNumber;function popupwindow(url,title,w,h){var left=screen.width/2-w/2,top=screen.height/2-h/2;return window.open(url,title,"toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width="+w+", height="+h+", top="+top+", left="+left)}function whatappValidation(fullTelephone,errorTarget){return fullTelephone&&"0"!=fullTelephone?(whatappErrorMessage(" ",errorTarget),!0):(whatappErrorMessage("Telephone number is not set or not valid.",errorTarget),!1)}function whatappErrorMessage(errorMessage,errorTarget){$("#"+errorTarget).text(errorMessage)}function whatappCreateFinalMessage(name, address,phone,email,message){return final_message="",void 0!==name&&(final_message+=name+" %0a"),void 0!==address&&(final_message+=address+" %0a"),void 0!==phone&&(final_message+=phone+" %0a"),void 0!==email&&(final_message+=email+" %0a"),final_message+=message.replace(/[\r\n]/g," %0a"),final_message}$("#whatapp-form").submit((function(e){e.preventDefault();var message=$("#wp-phone-message-message").val(),name=$("#wp-phone-message-name").val(),address=$("#wp-phone-message-address").val(),phone=$("#wp-phone-message-phone").val(),email=$("#wp-phone-message-email").val(),title=$("#wp-phone-message-title").val(),whatappUrl;whatappValidation(fullTelephone,"whatapp-error")&&(final_message=whatappCreateFinalMessage(name,address,phone,email,message),popupwindow("https://wa.me/"+fullTelephone+"?text="+final_message,title,1e3,700));return!1})),$("#whatapp-widget-form").submit((function(e){e.preventDefault();var message=$("#wp-phone-message-widget-message").val(),name=$("#wp-phone-message-widget-name").val(),address=$("#wp-phone-message-widget-address").val(),phone=$("#wp-phone-message-widget-phone").val(),email=$("#wp-phone-message-widget-email").val(),whatappUrl;whatappValidation(fullTelephone,"whatapp-widget-error")&&(final_message=whatappCreateFinalMessage(name,address,phone,email,message),popupwindow("https://wa.me/"+fullTelephone+"?text="+final_message,"Whatsapp Me",1e3,700));return!1}))}));1 jQuery(document).ready((function($){var fullTelephone=wp_phone_message_data.fullPhoneNumber;function popupwindow(url,title,w,h){var left=screen.width/2-w/2,top=screen.height/2-h/2;return window.open(url,title,"toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width="+w+", height="+h+", top="+top+", left="+left)}function whatappValidation(fullTelephone,errorTarget){return fullTelephone&&"0"!=fullTelephone?(whatappErrorMessage(" ",errorTarget),!0):(whatappErrorMessage("Telephone number is not set or not valid.",errorTarget),!1)}function whatappErrorMessage(errorMessage,errorTarget){$("#"+errorTarget).text(errorMessage)}function whatappCreateFinalMessage(name,extra,phone,email,message,dropdown){return final_message="",void 0!==name&&(final_message+=name+" %0a"),void 0!==extra&&(final_message+=extra+" %0a"),void 0!==phone&&(final_message+=phone+" %0a"),void 0!==email&&(final_message+=email+" %0a"),void 0!==dropdown&&(final_message+=dropdown+" %0a"),final_message+=message.replace(/[\r\n]/g," %0a"),final_message}$("#whatapp-form").submit((function(e){e.preventDefault();var message=$("#wp-phone-message-message").val(),name=$("#wp-phone-message-name").val(),extra=$("#wp-phone-message-extra").val(),phone=$("#wp-phone-message-phone").val(),email=$("#wp-phone-message-email").val(),dropdown=$("#wp-phone-message-dropdown").val(),title=$("#wp-phone-message-title").val(),whatappUrl;whatappValidation(fullTelephone,"whatapp-error")&&(final_message=whatappCreateFinalMessage(name,extra,phone,email,message,dropdown),popupwindow("https://wa.me/"+fullTelephone+"?text="+final_message,title,1e3,700));return!1})),$("#whatapp-widget-form").submit((function(e){e.preventDefault();var message=$("#wp-phone-message-widget-message").val(),name=$("#wp-phone-message-widget-name").val(),extra=$("#wp-phone-message-widget-extra").val(),phone=$("#wp-phone-message-widget-phone").val(),email=$("#wp-phone-message-widget-email").val(),dropdown=$("#wp-phone-message-widget-dropdown").val(),whatappUrl;whatappValidation(fullTelephone,"whatapp-widget-error")&&(final_message=whatappCreateFinalMessage(name,extra,phone,email,message,dropdown),popupwindow("https://wa.me/"+fullTelephone+"?text="+final_message,"Whatsapp Me",1e3,700));return!1}))})); -
wp-phone-message/trunk/readme.txt
r2447492 r2482736 1 1 === WP Phone Message === 2 Contributors: webmarcello 2 Contributors: webmarcello, freemius 3 3 Tags: message, form, whatsapp, shortcode, widget, phone, text 4 4 Requires at least: 4.5.13 … … 15 15 WP Phone Message is a Wordpress plugin that gives the possibility to render a simple message form that will open a Whatsapp chat on a new window. You will have the possibility to display the message form through shotcode in order to display the form inside a page or a post, or the possibility to display the message for through a widget. 16 16 17 From February 2021, WP Phone Message becomes Premium, the basic functions of the plugin are still free but you have more options and more styles available if you go Premium 18 17 19 = Settings include: = 18 20 * Enter your international prefix (required) 19 21 * Enter a valid whatsapp phone number (required) 20 22 * Enter the form title 23 24 = Shortcode Settings = 21 25 * Enter form text 22 26 * Enter form bottom text 23 * Possibility to add name field in shortcode form 24 * Possibility to add address field in shortcode form 25 * Possibility to add phone number field in shortcode form 26 * Possibility to add email address field in shortcode form 27 * Possibility to add name field in widget form 28 * Possibility to add address field in widget form 29 * Possibility to add phone number field in widget form 30 * Possibility to add email address field in widget form 27 * Possibility to add name field in shortcode form 28 * Possibility to add extra field in shortcode form (Premium) 29 * Possibility to add phone number field in shortcode form 30 * Possibility to add email address field in shortcode form (Premium) 31 * Possibility to add a dropdown field in shortcode form (Premium) 31 32 * Making fields mandatory 32 33 * Possibility to set fields placeholder … … 37 38 * Enter form text 38 39 * Possibility to add name field 39 * Possibility to add address field40 * Possibility to add extra field (Premium) 40 41 * Possibility to add phone number field 41 * Possibility to add email address field 42 * Possibility to add email address field (Premium) 43 * Possibility to add a dropdown field (Premium) 42 44 * Making fields mandatory 43 45 * Possibility to set fields placeholder 44 46 45 47 The widget will send the whatsapp to the phone number set on the setting section. 48 49 = Styles: = 50 (Premium) 51 You can now choose from 4 different form styles. 52 You can also add your own CSS style that will be added to the code as file. 46 53 47 54 == Settings == … … 64 71 How to add international contacts' phone numbers To add an international contact's phone number: 65 72 66 * Open your phone's addressbook.73 * Open your phone's extra book. 67 74 * When adding the contact's phone number, start by entering a plus sign (+). 68 75 * Enter the country code, followed by the full phone number. Note: A country code is a numerical prefix that must be entered before the full national phone number to make a call to another country. You can search online to find the country code you need. For example, if a contact in the United States (country code "1") has the area code "408" and phone number "XXX-XXXX", you'd enter +1 408 XXX XXXX. … … 71 78 72 79 * Make sure to remove any leading 0s or special calling codes. 73 * If you meant to add a local (in country) phone number to your phone's addressbook, enter the number as if you were calling your contact on the phone.80 * If you meant to add a local (in country) phone number to your phone's extra book, enter the number as if you were calling your contact on the phone. 74 81 * All phone numbers in Argentina (country code "54") should have a "9" between the country code and area code. The prefix "15" must be removed so the final number will have 13 digits total: +54 9 XXX XXX XXXX 75 82 * Phone numbers in Mexico (country code "52") need to have "1" after "+52", even if they're Nextel numbers. … … 90 97 == Changelog == 91 98 99 = 1.1.0 = 100 * Premium Version realeased 101 92 102 = 1.0.7 = 93 103 * Send phone number to JS through wp_localize … … 99 109 = 1.0.5 = 100 110 * Possibility to add name field in shortcode form 101 * Possibility to add addressfield in shortcode form111 * Possibility to add extra field in shortcode form 102 112 * Possibility to add phone number field in shortcode form 103 113 * Possibility to add email address field in shortcode form 104 114 * Possibility to add name field in widget form 105 * Possibility to add addressfield in widget form115 * Possibility to add extra field in widget form 106 116 * Possibility to add phone number field in widget form 107 117 * Possibility to add email address field in widget form … … 113 123 = 1.0.3 = 114 124 * Possibility to add name field 115 * Possibility to add addressfield125 * Possibility to add extra field 116 126 * Possibility to add phone number field 117 127 * Possibility to add email address field -
wp-phone-message/trunk/views/shortcode-form.php
r2447492 r2482736 1 1 <?php 2 2 3 $shortcode_form = '<div class="whatapp-wrapper">'; 3 4 $shortcode_form .= '<form class="whatapp-form" id="whatapp-form">'; 4 $shortcode_form .= '<h3 class="whatapp-title">' . get_option('wp-phone-message-title') . '</h3>'; 5 $shortcode_form .= '<p class="whatapp-text">' . get_option('wp-phone-message-text') . '</p>'; 6 7 if(get_option('wp-phone-message-name-active')){ 8 $shortcode_form .= '<input type="text" class="wp-phone-message-name" id="wp-phone-message-name" placeholder="' . get_option('wp-phone-message-name') . '" ' . get_option('wp-phone-message-name-mandatory') . ' />'; 5 $shortcode_form .= '<h3 class="whatapp-title">' . get_option( 'wp-phone-message-title' ) . '</h3>'; 6 $shortcode_form .= '<p class="whatapp-text">' . get_option( 'wp-phone-message-text' ) . '</p>'; 7 if ( get_option( 'wp-phone-message-name-active' ) ) { 8 $shortcode_form .= '<input type="text" class="wp-phone-message-name" id="wp-phone-message-name" placeholder="' . get_option( 'wp-phone-message-name' ) . '" ' . get_option( 'wp-phone-message-name-mandatory' ) . ' />'; 9 9 } 10 if (get_option('wp-phone-message-address-active')){11 $shortcode_form .= '<input type="te xt" class="wp-phone-message-address" id="wp-phone-message-address" placeholder="' . get_option('wp-phone-message-address') . '" ' . get_option('wp-phone-message-address-mandatory') . ' />';10 if ( get_option( 'wp-phone-message-phone-active' ) ) { 11 $shortcode_form .= '<input type="tel" class="wp-phone-message-phone" id="wp-phone-message-phone" placeholder="' . get_option( 'wp-phone-message-phone' ) . '" ' . get_option( 'wp-phone-message-phone-mandatory' ) . ' />'; 12 12 } 13 if(get_option('wp-phone-message-phone-active')){ 14 $shortcode_form .= '<input type="text" class="wp-phone-message-phone" id="wp-phone-message-phone" placeholder="' . get_option('wp-phone-message-phone') . '" ' . get_option('wp-phone-message-phone-mandatory') . ' />'; 15 } 16 if(get_option('wp-phone-message-email-active')){ 17 $shortcode_form .= '<input type="email" class="wp-phone-message-email" id="wp-phone-message-email" placeholder="' . get_option('wp-phone-message-email') . '" ' . get_option('wp-phone-message-email-mandatory') . ' />'; 18 } 19 20 $shortcode_form .= '<textarea class="wp-phone-message-message" id="wp-phone-message-message" placeholder="' . get_option('wp-phone-message-textarea') . '" required ></textarea>'; 13 $shortcode_form .= '<textarea class="wp-phone-message-message" id="wp-phone-message-message" placeholder="' . get_option( 'wp-phone-message-textarea' ) . '" required ></textarea>'; 21 14 $shortcode_form .= '<p class="whatapp-error" id="whatapp-error" ></p>'; 22 $shortcode_form .= '<input type="submit" class="wp-phone-message-button" id="wp-phone-message-button" value="' . get_option( 'wp-phone-message-button') . '" />';15 $shortcode_form .= '<input type="submit" class="wp-phone-message-button" id="wp-phone-message-button" value="' . get_option( 'wp-phone-message-button' ) . '" />'; 23 16 $shortcode_form .= '</form>'; 24 17 $shortcode_form .= '</div>'; -
wp-phone-message/trunk/views/widget-form.php
r2447492 r2482736 1 1 <div class="whatapp-wrapper"> 2 2 <form class="whatapp-form" id="whatapp-widget-form"> 3 <p class="whatapp-text"><?= $text; ?></p> 4 <?php 5 if(get_option('wp-phone-message-name-active-widget')){ 6 echo '<input type="text" class="wp-phone-message-name" id="wp-phone-message-widget-name" placeholder="' . get_option('wp-phone-message-name') . '" ' . get_option('wp-phone-message-name-mandatory') . ' />'; 7 } 8 if(get_option('wp-phone-message-address-active-widget')){ 9 echo '<input type="text" class="wp-phone-message-address" id="wp-phone-message-widget-address" placeholder="' . get_option('wp-phone-message-address') . '" ' . get_option('wp-phone-message-address-mandatory') . ' />'; 10 } 11 if(get_option('wp-phone-message-phone-active-widget')){ 12 echo '<input type="text" class="wp-phone-message-phone" id="wp-phone-message-widget-phone" placeholder="' . get_option('wp-phone-message-phone') . '" ' . get_option('wp-phone-message-phone-mandatory') . ' />'; 13 } 14 if(get_option('wp-phone-message-email-active-widget')){ 15 echo '<input type="email" class="wp-phone-message-email" id="wp-phone-message-widget-email" placeholder="' . get_option('wp-phone-message-email') . '" ' . get_option('wp-phone-message-email-mandatory') . ' />'; 16 } 17 ?> 18 <textarea class="wp-phone-message-message" id="wp-phone-message-widget-message" placeholder="<?= get_option('wp-phone-message-textarea'); ?>" required></textarea> 3 <p class="whatapp-text"><?php 4 echo $text ; 5 ?></p> 6 <?php 7 if ( get_option( 'wp-phone-message-name-active-widget' ) ) { 8 echo '<input type="text" class="wp-phone-message-name" id="wp-phone-message-widget-name" placeholder="' . get_option( 'wp-phone-message-name-widget' ) . '" ' . get_option( 'wp-phone-message-name-mandatory-widget' ) . ' />' ; 9 } 10 if ( get_option( 'wp-phone-message-phone-active-widget' ) ) { 11 echo '<input type="tel" class="wp-phone-message-phone" id="wp-phone-message-widget-phone" placeholder="' . get_option( 'wp-phone-message-phone-widget' ) . '" ' . get_option( 'wp-phone-message-phone-mandatory-widget' ) . ' />' ; 12 } 13 ?> 14 <textarea class="wp-phone-message-message" id="wp-phone-message-widget-message" placeholder="<?php 15 echo get_option( 'wp-phone-message-textarea-widget' ) ; 16 ?>" required></textarea> 19 17 <p class="whatapp-error" id="whatapp-widget-error" ></p> 20 <input type="submit" class="wp-phone-message-button" id="wp-phone-message-widget-button" value="<?= get_option('wp-phone-message-button'); ?>" /> 18 <input type="submit" class="wp-phone-message-button" id="wp-phone-message-widget-button" value="<?php 19 echo get_option( 'wp-phone-message-button-widget' ) ; 20 ?>" /> 21 21 </form> 22 22 </div> -
wp-phone-message/trunk/wp-phone-message.php
r2447494 r2482736 2 2 /** 3 3 * Plugin Name: WP Phone Message 4 * Plugin URI: https:// github.com/webmarcello8080/wp-phone-message4 * Plugin URI: https://webmarcello.co.uk/blog/wp-phone-message-plugin/ 5 5 * Description: Send a whatsapp message from your Wordpress website. You can render a message form through shotcode or widget. 6 * Version: 1. 0.76 * Version: 1.1.0 7 7 * Requires at least: 4.5.13 8 8 * Requires PHP: 5.6 9 9 * Author: Marcello Perri 10 10 * Author URI: http://webmarcello.co.uk 11 * Text Domain: wp-phone-message 11 12 */ 12 13 … … 14 15 define('PLUGIN_WPM_BASENAME', plugin_basename(__FILE__) ); 15 16 17 // import files from folder 'includes' 16 18 foreach ( glob( plugin_dir_path( __FILE__ ) .'includes/*.php') as $filename) 17 19 { … … 19 21 } 20 22 23 // load classes, create an instance of the classes to run __constructs 21 24 if ( !function_exists( 'wp_phone_message_loader' ) ) { 22 25 function wp_phone_message_loader(){ … … 25 28 } 26 29 new WpPhoneMessageShortcode; 30 new WpPhoneMessageFrontend; 27 31 } 28 32 add_action('plugins_loaded', 'wp_phone_message_loader'); … … 36 40 add_action( 'widgets_init', 'wp_phone_message_load_widget' ); 37 41 } 42 43 // plugin uninstallation 44 register_uninstall_hook( __FILE__, 'wp_phone_message_uninstall' ); 45 function wp_phone_message_uninstall() { 46 deletePlugin(); 47 }
Note: See TracChangeset
for help on using the changeset viewer.