You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
3.1 KiB
74 lines
3.1 KiB
<?php
|
|
/**
|
|
* Plugin Name: WPSyncSheets Lite For Contact Form 7
|
|
* Plugin URI: https://www.wpsyncsheets.com/wpsyncsheets-for-contact-form-7/
|
|
* Description: Send your Contact Form 7 data to your Google Sheets spreadsheet.
|
|
* Version: 1.5
|
|
* Author: Creative Werk Designs
|
|
* Author URI: http://www.creativewerkdesigns.com/
|
|
* Text Domain: wpssc
|
|
* Domain Path: /languages
|
|
* @package contactsheets-lite
|
|
* @author Creative Werk Designs
|
|
* @Category Plugin
|
|
* @copyright Copyright (c) 2021 Creative Werk Designs
|
|
*/
|
|
|
|
if ( ! get_option( 'active_wpsyncsheets_contactform7' ) ) {
|
|
// Plugin version.
|
|
define( 'WPSSLC_VERSION', '1.5' );
|
|
define( 'WPSSLC_DB_VERSION', '1.0' );
|
|
define( 'WPSSLC_DIR', plugin_dir_path( __FILE__ ) );
|
|
define( 'WPSSLC_ROOT', dirname( __FILE__ ) );
|
|
define( 'WPSSLC_URL', plugins_url( '/', __FILE__ ) );
|
|
define( 'WPSSLC_BASE_FILE', basename( dirname( __FILE__ ) ) . '/wpsyncsheets-lite-contact-form-7.php' );
|
|
define( 'WPSSLC_BASE_NAME', plugin_basename( __FILE__ ) );
|
|
define( 'WPSSLC_PATH', plugin_dir_path( __FILE__ ) );// use for include files to other files.
|
|
define( 'WPSSLC_DIRECTORY', dirname( plugin_basename( __FILE__ ) ) );
|
|
define( 'WPSSLC_DOCS_LINK', 'https://docs.wpsyncsheets.com/wpssc-introduction/' );
|
|
define( 'WPSSLC_DOC_MENU_URL', 'https://docs.wpsyncsheets.com' );
|
|
define( 'WPSSLC_SUPPORT_MENU_URL', 'https://wordpress.org/support/plugin/contactsheets-lite/' );
|
|
define( 'WPSSLC_PRO_VERSION_URL', 'https://www.wpsyncsheets.com/wpsyncsheets-for-contact-form-7/' );
|
|
define( 'WPSSLC_PRO_VERSION_BUY_URL', 'https://www.wpsyncsheets.com/pricing/?utm_source=liteplugin&utm_medium=admindescription&utm_campaign=wpsyncsheets_lite_for_contact_form_7' );
|
|
/**
|
|
* Check Contact Form 7 plugin is active or not.
|
|
*
|
|
* @param string $plugin Plugin Array.
|
|
*/
|
|
function wpsslc_is_contact_form_7_plugin_active( $plugin ) {
|
|
return in_array( $plugin, (array) get_option( 'active_plugins', array() ), true );
|
|
}
|
|
if ( wpsslc_is_contact_form_7_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) {
|
|
// Add methods if Contact Form 7 is active.
|
|
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'wpsslc_add_action_links' );
|
|
/**
|
|
* Add action link if Contact Form 7 is active.
|
|
*
|
|
* @param array $links .
|
|
* @return array
|
|
*/
|
|
function wpsslc_add_action_links( $links ) {
|
|
$mylinks = array(
|
|
'<a href="' . esc_url( admin_url( 'admin.php?page=wpsyncsheets-contact-form-7' ) ) . '">' . esc_html__( 'Settings', 'wpssc' ) . '</a>',
|
|
);
|
|
return array_merge( $mylinks, $links );
|
|
}
|
|
} else {
|
|
add_action( 'admin_notices', 'wpsslc_admin_notice' );
|
|
if ( ! function_exists( 'wpsslc_admin_notice' ) ) {
|
|
/**
|
|
* Add admin notice.
|
|
*/
|
|
function wpsslc_admin_notice() {
|
|
echo '<div class="notice error wpsslc-error">
|
|
<div class="wpsslc-message-icon" >
|
|
<p>WPSyncSheets Lite For Contact Form 7 plugin requires <a href=' . esc_url( 'https://wordpress.org/plugins/contact-form-7/' ) . '>Contact Form 7</a> plugin to be active!</p>
|
|
</div>
|
|
</div>';
|
|
}
|
|
}
|
|
}
|
|
// Define the class and the function.
|
|
require_once dirname( __FILE__ ) . '/src/class-contactsheetslite.php';
|
|
wpsslc();
|
|
}
|
|
|