Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
592 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
jQuery( document ).ready( function ( e ) { | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
jQuery( document ).ready( function ( e ) { | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
|
||
// Silence is golden |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copyright (C) 2014 WordPress Plugin Template | ||
# This file is distributed under the same license as the WordPress Plugin Template package. | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: MailPoet\n" | ||
"Report-Msgid-Bugs-To: http://mailpoet.com\n" | ||
"POT-Creation-Date: 2014-04-07 11:28:06+00:00\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"PO-Revision-Date: 2014-MO-DA HO:MI+ZONE\n" | ||
"Last-Translator: MAILPOET <info@mailpoet.com>\n" | ||
"Language-Team: MAILPOET <info@mailpoet.com>\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
<?php | ||
if (!defined('ABSPATH')) exit; | ||
|
||
class MailPoet { | ||
|
||
public $version; | ||
public $shortname; | ||
public $file; | ||
public $dir; | ||
public $assets_dir; | ||
public $assets_url; | ||
|
||
|
||
public function __construct ($params = array( | ||
'file' => '', | ||
'version' => '1.0.0' | ||
)) { | ||
|
||
$this->version = $params['version']; | ||
$this->shortname = 'mailpoet'; | ||
$this->file = $params['file']; | ||
$this->dir = dirname($this->file); | ||
$this->assets_dir = $this->dir . 'assets/'; | ||
$this->assets_url = plugins_url( | ||
'/assets/', | ||
$this->file | ||
); | ||
|
||
register_activation_hook( | ||
$this->file, | ||
array($this, 'install') | ||
); | ||
|
||
// public assets | ||
add_action( | ||
'wp_enqueue_scripts', | ||
array($this, 'public_css'), | ||
10 | ||
); | ||
add_action( | ||
'wp_enqueue_scripts', | ||
array($this, 'public_js'), | ||
10 | ||
); | ||
|
||
// admin assets | ||
add_action( | ||
'admin_enqueue_scripts', | ||
array($this, 'admin_css'), | ||
10, | ||
1 | ||
); | ||
add_action( | ||
'admin_enqueue_scripts', | ||
array($this, 'admin_js'), | ||
10, | ||
1 | ||
); | ||
|
||
// localization | ||
$this->setup_textdomain(); | ||
add_action( | ||
'init', | ||
array($this, 'localize'), | ||
0 | ||
); | ||
} | ||
|
||
public function public_css() { | ||
$name = $this->shortname . '-public'; | ||
|
||
wp_register_style( | ||
$name, | ||
$this->assets_url . 'css/public.css', | ||
array(), | ||
$this->version | ||
); | ||
wp_enqueue_style($name); | ||
} | ||
|
||
public function public_js() { | ||
$name = $this->shortname . '-public'; | ||
wp_register_script( | ||
$name, | ||
$this->assets_url . 'js/public.js', | ||
array('jquery'), | ||
$this->version | ||
); | ||
wp_enqueue_script($name); | ||
} | ||
|
||
public function admin_css($hook = '') { | ||
$name = $this->shortname . '-admin'; | ||
wp_register_style( | ||
$name, | ||
$this->assets_url . 'css/admin.css', | ||
array(), $this->version | ||
); | ||
wp_enqueue_style($name); | ||
} | ||
|
||
public function admin_js($hook = '') { | ||
$name = $this->shortname . '-admin'; | ||
wp_register_script( | ||
$this->shortname . '-admin', | ||
$this->assets_url . 'js/admin.js', | ||
array('jquery'), | ||
$this->version | ||
); | ||
wp_enqueue_script($name); | ||
} | ||
|
||
public function localize() { | ||
load_plugin_textdomain( | ||
$this->shortname, | ||
false, | ||
dirname(plugin_basename($this->file)) . '/lang/' | ||
); | ||
} | ||
|
||
public function setup_textdomain() { | ||
$domain = 'mailpoet'; | ||
$locale = apply_filters( | ||
'plugin_locale', | ||
get_locale(), | ||
$domain | ||
); | ||
|
||
$language_path = WP_LANG_DIR | ||
. '/' | ||
. $domain | ||
. '/' | ||
. $domain | ||
. '-' | ||
. $locale | ||
. '.mo'; | ||
|
||
load_textdomain($domain, $language_path); | ||
load_plugin_textdomain( | ||
$domain, | ||
false, | ||
dirname(plugin_basename($this->file)) . '/lang/' | ||
); | ||
} | ||
|
||
public function install() { | ||
$this->log_version_number(); | ||
} | ||
|
||
private function log_version_number() { | ||
update_option( | ||
$this->shortname . '_version', $this->version | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
if (!defined('ABSPATH')) exit; | ||
|
||
/* | ||
* Plugin Name: MailPoet | ||
* Version: 1.0 | ||
* Plugin URI: http://www.mailpoet.com | ||
* Description: MailPoet Newsletters. | ||
* Author: MailPoet | ||
* Author URI: http://www.mailpoet.com | ||
* Requires at least: 4.0 | ||
* Tested up to: 4.0 | ||
* | ||
* Text Domain: mailpoet | ||
* Domain Path: /lang/ | ||
* | ||
* @package WordPress | ||
* @author MailPoet | ||
* @since 1.0.0 | ||
*/ | ||
|
||
require_once('lib/mailpoet.php'); | ||
|
||
function mailpoet() { | ||
return new MailPoet(array( | ||
'file' => __FILE__, | ||
'version' => '1.0.0' | ||
)); | ||
} | ||
|
||
mailpoet(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
=== MailPoet === | ||
Contributors: mailpoet | ||
Donate link: http://mailpoet.com | ||
Tags: wordpress, plugin | ||
Requires at least: 4.0 | ||
Tested up to: 4.0 | ||
Stable tag: 1.0 | ||
License: GPLv2 or later | ||
License URI: http://www.gnu.org/licenses/gpl-2.0.html | ||
|
||
MailPoet newsletters. | ||
|
||
== Description == | ||
|
||
Long description. | ||
|
||
== Installation == | ||
|
||
Installation instructions. | ||
|
||
== Screenshots == | ||
|
||
Screenshots. | ||
|
||
== Frequently Asked Questions == | ||
|
||
= Question? = | ||
|
||
Answer. | ||
|
||
== Changelog == | ||
|
||
= 1.0 = | ||
* 2020-01-01 | ||
* Initial release | ||
|
||
== Upgrade Notice == | ||
|
||
= 1.0 = | ||
* 2020-01-01 | ||
* Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?php | ||
if (!defined('WP_UNINSTALL_PLUGIN')) exit; | ||
|
||
// Runs on uninstallation, not on deactivation. |