This commit is contained in:
2026-04-26 23:47:49 +02:00
parent 1b95f03d1e
commit b073e009d8
5288 changed files with 1112699 additions and 55536 deletions

View File

@@ -0,0 +1,2 @@
<?php
// Silence is golden.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,50 @@
<?php
/*
* Plugin Name Native Emoji
* Version 3.0.1
* Author Daniel Brandenburg
*/
// Required files
$parse_uri = explode( 'wp-content', $_SERVER[ 'SCRIPT_FILENAME' ] );
require_once( $parse_uri[ 0 ] . 'wp-load.php' );
// Check if post content
if( $_POST ){
// Post Vars
$class = esc_sql( $_POST[ 'class' ] );
$key = esc_sql( $_POST[ 'key' ] );
$code = htmlspecialchars( '&#x' . str_replace( '-', '&#x', $key ) . ';' );
// SQL vars
global $wpbd;
$table_name = $wpdb->prefix . 'nep_native_emoji';
$uid = get_current_user_id();
$time = current_time( 'mysql' );
if( $uid == 0 )
return;
// Insert Data to table
$existent_emoji = $wpdb->get_row( "SELECT * FROM $table_name WHERE btn_id = '$key' AND uid = '$uid'" );
if ( $existent_emoji == null ) {
$wpdb->insert(
$table_name,
array( 'time' => $time, 'btn_id' => $key, 'class' => $class, 'code' => $code, 'uid' => $uid ),
array( '%s','%s','%s','%s','%d' )
);
}
else {
$wpdb->update(
$table_name,
array( 'time' => $time ),
array( 'btn_id' => $key ),
array( '%s' ),
array( '%s' )
);
}
}
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

View File

@@ -0,0 +1,2 @@
<?php
// Silence is golden.

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,3 @@
<?php
// Silence is golden.
?>

View File

@@ -0,0 +1,2 @@
<?php
// Silence is golden.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
<?php
// Silence is golden.

View File

@@ -0,0 +1,226 @@
msgid ""
msgstr ""
"Project-Id-Version: Native Emoji 3.0\n"
"POT-Creation-Date: 2017-12-18 23:48-0600\n"
"PO-Revision-Date: 2017-12-18 23:56-0600\n"
"Last-Translator: \n"
"Language-Team: Daniel Brandenburg <davabuu@ymail.com>\n"
"Language: es_MX\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.6\n"
"X-Poedit-Basepath: ..\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: __;_e\n"
"X-Poedit-SearchPath-0: native-emoji.php\n"
#: native-emoji.php:50
msgid "configure your settings"
msgstr ""
#: native-emoji.php:53
#, php-format
msgid ""
"Thanks for installing Emoji Native Plugin, before using you must you must "
"%1$s"
msgstr ""
#: native-emoji.php:56
msgid "Discard this notice"
msgstr ""
#: native-emoji.php:64
msgid "Settings"
msgstr ""
#: native-emoji.php:127 native-emoji.php:161 native-emoji.php:168
#: native-emoji.php:321
msgid "Native Emoji"
msgstr ""
#: native-emoji.php:128 native-emoji.php:323
msgid "Frequently Used"
msgstr ""
#: native-emoji.php:129 native-emoji.php:324
msgid "Smileys & People"
msgstr ""
#: native-emoji.php:130 native-emoji.php:325
msgid "Animals & Nature"
msgstr ""
#: native-emoji.php:131 native-emoji.php:326
msgid "Food & Drink"
msgstr ""
#: native-emoji.php:132 native-emoji.php:327
msgid "Activity & Sports"
msgstr ""
#: native-emoji.php:133 native-emoji.php:328
msgid "Travel & Places"
msgstr ""
#: native-emoji.php:134 native-emoji.php:329
msgid "Objects"
msgstr ""
#: native-emoji.php:135 native-emoji.php:330
msgid "Symbols"
msgstr ""
#: native-emoji.php:136 native-emoji.php:331
msgid "Flags"
msgstr ""
#: native-emoji.php:137 native-emoji.php:332
msgid "No Skin Tone"
msgstr ""
#: native-emoji.php:138 native-emoji.php:333
msgid "Light Skin Tone"
msgstr ""
#: native-emoji.php:139 native-emoji.php:334
msgid "Medium Light Skin Tone"
msgstr ""
#: native-emoji.php:140 native-emoji.php:335
msgid "Medium Skin Tone"
msgstr ""
#: native-emoji.php:141 native-emoji.php:336
msgid "Medium Dark Skin Tone"
msgstr ""
#: native-emoji.php:142 native-emoji.php:337
msgid "Dark Skin Tone"
msgstr ""
#: native-emoji.php:144 native-emoji.php:340
msgid "Close"
msgstr ""
#: native-emoji.php:170
msgid "Donate"
msgstr ""
#: native-emoji.php:171
msgid "Review"
msgstr ""
#: native-emoji.php:172
msgid "Live Demo"
msgstr ""
#: native-emoji.php:180
msgid "Admin editor"
msgstr ""
#: native-emoji.php:183
msgid "Enable plugin on admin editor"
msgstr ""
#: native-emoji.php:186 native-emoji.php:220
msgid "Enable"
msgstr ""
#: native-emoji.php:192
msgid "Other admin editor settings"
msgstr ""
#: native-emoji.php:195 native-emoji.php:198 native-emoji.php:245
#: native-emoji.php:248
msgid "Close panel after insert an emoji"
msgstr ""
#: native-emoji.php:207
msgid "Notices"
msgstr ""
#: native-emoji.php:209
msgid ""
"Make sure to check the box if your website uses jQuery, otherwise the plugin "
"may cause errors in your website"
msgstr ""
#: native-emoji.php:210
msgid ""
"The plugin tries to preserve the css properties of the comments box, in case "
"something has been omitted, use your custom css under the tag"
msgstr ""
#: native-emoji.php:214
msgid "Front end comments"
msgstr ""
#: native-emoji.php:217
msgid "Enable plugin on front end comments"
msgstr ""
#: native-emoji.php:226
msgid "Other comments settings"
msgstr ""
#: native-emoji.php:229
msgid "Does your website uses jQuery library?"
msgstr ""
#: native-emoji.php:232
msgid "My website uses jQuery library"
msgstr ""
#: native-emoji.php:237
msgid "Do you want to display the plugin on mobile devices?"
msgstr ""
#: native-emoji.php:240
msgid "Display on mobile devices"
msgstr ""
#: native-emoji.php:253
msgid "Comments emoji panel color"
msgstr ""
#: native-emoji.php:254
msgid "Panel color"
msgstr ""
#: native-emoji.php:258
msgid "Light"
msgstr ""
#: native-emoji.php:263
msgid "Dark"
msgstr ""
#: native-emoji.php:267
msgid "Comments emoji panel position"
msgstr ""
#: native-emoji.php:268
msgid "Panel position"
msgstr ""
#: native-emoji.php:272
msgid "Right Bottom"
msgstr ""
#: native-emoji.php:277
msgid "Right Top"
msgstr ""
#: native-emoji.php:282
msgid "Left Bottom"
msgstr ""
#: native-emoji.php:287
msgid "Left Top"
msgstr ""
#: native-emoji.php:322 native-emoji.php:376
msgid "Insert Emoji"
msgstr ""

View File

@@ -0,0 +1,281 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS

View File

@@ -0,0 +1,292 @@
<?php
/*
* Plugin Name: Native Emoji
* Plugin URI: http://native-emoji.davabuu.net/
* Description: This is not just a plugin, this is the plugin for use <cite>emoji</cite> in a native way in your <cite>posts and comments</cite>. When activated you will see a new button in your wordpress editor or comments box, from there you will be able to include more than 2,000 emojis.
* Version: 3.0.1
* Author: Daniel Brandenburg
* Text Domain: native-emoji
* Domain Path: /languages
*/
// Define Plugin Class
class WP_nep_Native_Emoji{
// Constructor
function __construct() {
// Actions
add_action( 'admin_notices', array( $this, 'nep_activation_msg' ), 99 );
add_action( 'plugins_loaded', array( $this, 'nep_localize_plugin' ), 99 );
add_action( 'admin_init', array( $this, 'nep_resgiter_plugin_settings' ), 99 );
add_action( 'admin_enqueue_scripts', array( $this, 'nep_register_and_enqueue_admin_files' ), 99 );
add_action( 'wp_enqueue_scripts', array( $this, 'nep_register_and_enqueue_files' ), 99 );
add_action( 'admin_menu', array( $this, 'nep_add_options_page' ), 99 );
foreach ( array( 'post.php','post-new.php' ) as $hook ) {
add_action( 'admin_head-' . $hook, array( $this, 'nep_plugin_js_vars' ), 99 );
}
// Filters
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'nep_link_actions' ), 99, 1 );
add_filter( 'mce_buttons', array( $this, 'nep_tinymce_button' ), 99, 1 );
add_filter( 'mce_external_plugins', array( $this, 'nep_tinymce_plugin' ), 99, 1 );
add_filter( 'comment_form_field_comment', array( $this, 'nep_comments_template' ), 99, 1 );
// Activation and desactivation hooks
register_activation_hook( __FILE__, array( $this, 'nep_emoji_install' ) );
register_deactivation_hook( __FILE__, array( $this, 'nep_emoji_uninstall' ) );
}
// Display Activation Message
function nep_activation_msg() {
if( is_plugin_active( 'native-emoji/index.php' ) && !get_option( 'nep_native_emoji_active' ) ){
// Add plugin options
add_option( 'nep_native_emoji_active', 'true' );
// Display Message
$settings_link = '<a href="options-general.php?page=nep_native_emoji">' . __( 'configure your settings', 'native-emoji' ) . '</a>';
echo '<div id="message" class="updated notice is-dismissible"><p>';
printf(
__( 'Thanks for installing Emoji Native Plugin, before using you must you must %1$s', 'native-emoji' ),
$settings_link
);
echo '</p><button type="button" class="notice-dismiss"><span class="screen-reader-text">' . __( 'Discard this notice', 'native-emoji' ) . '</span></button></div>';
}
}
// Plugin Link Actions
function nep_link_actions( $links ) {
$mylinks = array(
'<a href="options-general.php?page=nep_native_emoji">' . __( 'Settings', 'native-emoji' ) . '</a>',
);
return array_merge( $links, $mylinks );
}
// Localize The Plugn
function nep_localize_plugin() {
load_plugin_textdomain( 'native-emoji', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' );
}
// Register Plugin Settings
function nep_resgiter_plugin_settings() {
register_setting( 'nep_native_emoji_settings', 'nep_plugin_admin_activation' );
register_setting( 'nep_native_emoji_settings', 'nep_plugin_close_panel' );
register_setting( 'nep_native_emoji_settings', 'nep_plugin_comments_activation' );
register_setting( 'nep_native_emoji_settings', 'nep_plugin_site_use_jquery' );
register_setting( 'nep_native_emoji_settings', 'nep_plugin_show_on_mobile' );
register_setting( 'nep_native_emoji_settings', 'nep_plugin_panel_color' );
register_setting( 'nep_native_emoji_settings', 'nep_plugin_panel_position' );
register_setting( 'nep_native_emoji_settings', 'nep_plugin_close_panel_comments' );
}
// Register and enqueue admin CSS and JS files
function nep_register_and_enqueue_admin_files(){
global $pagenow;
$screen = get_current_screen();
// Register required files
wp_register_style( 'nep_native_emoji_admin', plugins_url( '/css/native_emoji_admin.css', __FILE__ ), false, '3.0.1', 'all' );
// Enqueue required files
if( $pagenow == 'post.php' && get_option( 'nep_plugin_admin_activation' ) || $pagenow == 'post-new.php' && get_option( 'nep_plugin_admin_activation' ) ){
wp_enqueue_style( 'nep_native_emoji_admin' );
wp_enqueue_script( 'jquery' );
}
if( $screen->id == 'settings_page_nep_native_emoji' ){
wp_enqueue_style( 'nep_native_emoji_admin' );
}
}
// Register and enqueue front end CSS and JS files
function nep_register_and_enqueue_files (){
if( !get_option( 'nep_plugin_comments_activation' ) )
return;
// Register required files
wp_register_style( 'nep_native_emoji', plugins_url( '/css/native_emoji.css', __FILE__ ), false, '3.0.1', 'all' );
wp_register_script( 'nep_native_emoji', plugins_url( '/js/native_emoji.js', __FILE__ ), 'jquery', '3.0.1', true );
// Get Frequently used emojis
global $wpdb;
$fu_emojis_codes = array();
$plugin_url = plugins_url( '/', __FILE__ );
$table_name = $wpdb->prefix . 'nep_native_emoji';
$uid = get_current_user_id();
$fu_emojis = $wpdb->get_results( "SELECT * FROM $table_name WHERE uid = '$uid' ORDER BY time DESC LIMIT 0,42" );
foreach($fu_emojis as $emoji){
$fu_emojis_codes[] = array( 'id' => $emoji->btn_id, 'class' => $emoji->class, 'code' => $emoji->code );
}
//Localize Script
$nep_js_var = array(
'nep_name' => __( 'Native Emoji', 'native-emoji' ),
'nep_frequently_used' => __( 'Frequently Used', 'native-emoji' ),
'nep_smileys_people' => __( 'Smileys & People', 'native-emoji' ),
'nep_animals_nature' => __( 'Animals & Nature', 'native-emoji' ),
'nep_food_drink' => __( 'Food & Drink', 'native-emoji' ),
'nep_activity_sports' => __( 'Activity & Sports', 'native-emoji' ),
'nep_travel_places' => __( 'Travel & Places', 'native-emoji' ),
'nep_objects' => __( 'Objects', 'native-emoji' ),
'nep_symbols' => __( 'Symbols', 'native-emoji' ),
'nep_flags' => __( 'Flags', 'native-emoji' ),
'nep_yellow' => __( 'No Skin Tone', 'native-emoji' ),
'nep_pale' => __( 'Light Skin Tone', 'native-emoji' ),
'nep_cream' => __( 'Medium Light Skin Tone', 'native-emoji' ),
'nep_moderate_brown' => __( 'Medium Skin Tone', 'native-emoji' ),
'nep_dark_brown' => __( 'Medium Dark Skin Tone', 'native-emoji' ),
'nep_black' => __( 'Dark Skin Tone', 'native-emoji' ),
'nep_url' => $plugin_url,
'nep_close' => __( 'Close' )
);
wp_localize_script( 'nep_native_emoji', 'nep_plugin_vars', $nep_js_var );
wp_localize_script( 'nep_native_emoji', 'nep_frequently_used', $fu_emojis_codes );
// Enqueue required files
if ( comments_open() || get_comments_number() ) {
wp_enqueue_style( 'nep_native_emoji' );
if( !get_option( 'nep_plugin_site_use_jquery' ) ){
wp_enqueue_script( 'jquery' );
}
wp_enqueue_script( 'nep_native_emoji' );
}
}
// Add Options Page
function nep_add_options_page(){
add_options_page( __( 'Native Emoji', 'native-emoji' ), __( 'Native Emoji', 'native-emoji' ), 'activate_plugins', 'nep_native_emoji', array( $this, 'nep_options_page' ) );
}
// Options Page
function nep_options_page(){
return require_once( 'options-page.php' );
}
// Localize tinymce and add vars to js plugin
function nep_plugin_js_vars() {
if( !get_option( 'nep_plugin_admin_activation' ) )
return;
// Add inline script
global $wpdb, $locale; $i= 0;
$fu_emojis_codes = array();
$plugin_url = plugins_url( '/', __FILE__ );
$table_name = $wpdb->prefix . 'nep_native_emoji';
$uid = get_current_user_id();
$fu_emojis = $wpdb->get_results( "SELECT * FROM $table_name WHERE uid = '$uid' ORDER BY time DESC LIMIT 0,42" );
$close = get_option( 'nep_plugin_close_panel' ) ? 'true' : 'false';
foreach($fu_emojis as $emoji){
$decode_emoji = html_entity_decode( $emoji->code );
$fu_emojis_codes[] = "{'id' : '$emoji->btn_id', 'class' : '$emoji->class', 'code' : '$decode_emoji' }";
}
$inlineScript = "<!-- TinyMCE Native Emoji Plugin -->\n";
$inlineScript .= "<script type='text/javascript'>";
$inlineScript .= "var nep_plugin_vars = {";
$inlineScript .= "'nep_name':'" . __('Native Emoji', 'native-emoji') . "',";
$inlineScript .= "'nep_insert_emoji':'" . __('Insert Emoji', 'native-emoji') . "',";
$inlineScript .= "'nep_frequently_used':'" . __('Frequently Used', 'native-emoji') . "',";
$inlineScript .= "'nep_smileys_people':'" . __('Smileys & People', 'native-emoji') . "',";
$inlineScript .= "'nep_animals_nature':'" . __('Animals & Nature', 'native-emoji') . "',";
$inlineScript .= "'nep_food_drink':'" . __('Food & Drink', 'native-emoji') . "',";
$inlineScript .= "'nep_activity_sports':'" . __('Activity & Sports', 'native-emoji') . "',";
$inlineScript .= "'nep_travel_places':'" . __('Travel & Places', 'native-emoji') . "',";
$inlineScript .= "'nep_objects':'" . __('Objects', 'native-emoji') . "',";
$inlineScript .= "'nep_symbols':'" . __('Symbols', 'native-emoji') . "',";
$inlineScript .= "'nep_flags':'" . __('Flags', 'native-emoji') . "',";
$inlineScript .= "'nep_yellow':'" . __('No Skin Tone', 'native-emoji') . "',";
$inlineScript .= "'nep_pale':'" . __('Light Skin Tone', 'native-emoji') . "',";
$inlineScript .= "'nep_cream':'" . __('Medium Light Skin Tone', 'native-emoji') . "',";
$inlineScript .= "'nep_moderate_brown':'" . __('Medium Skin Tone', 'native-emoji') . "',";
$inlineScript .= "'nep_dark_brown':'" . __('Medium Dark Skin Tone', 'native-emoji') . "',";
$inlineScript .= "'nep_black':'" . __('Dark Skin Tone', 'native-emoji') . "',";
$inlineScript .= "'nep_url':'". $plugin_url . "',";
$inlineScript .= "'nep_close_panel':" . $close . ",";
$inlineScript .= "'nep_close':'" . __('Close') . "',";
$inlineScript .= "'nep_frequently_codes':[" . implode(',',$fu_emojis_codes) . "]";
$inlineScript .= "};";
$inlineScript .= "</script>\n";
$inlineScript .= "<!-- TinyMCE Native Emoji Plugin -->\n";
echo $inlineScript;
}
// Register TinyMCE Button
function nep_tinymce_button( $buttons ) {
if( !get_option( 'nep_plugin_admin_activation' ) )
return $buttons;
array_push( $buttons, 'separator', 'nep_native_emoji' );
return $buttons;
}
// Register TinyMCE Pluglin
function nep_tinymce_plugin( $plugin_array ) {
if( !get_option('nep_plugin_admin_activation' ) )
return;
$plugin_array[ 'nep_native_emoji' ] = plugins_url( '/js/native_emoji_tinymce-plugin.js', __FILE__ );
return $plugin_array;
}
// Comments Template
function nep_comments_template( $field ) {
if( !get_option( 'nep_plugin_comments_activation' ) )
return $field;
$theme = get_option( 'nep_plugin_panel_color' );
$mobile = get_option( 'nep_plugin_show_on_mobile' ) ? 'true' : 'false';
$close = get_option( 'nep_plugin_close_panel_comments' ) ? 'true' : 'false';
$position = get_option( 'nep_plugin_panel_position' );
$data_settings = "{'theme':'". $theme ."', 'showOnMobile':" . $mobile . ", 'close':" . $close . ", 'position':'" . $position . "'}";
$btn = "\t" .'<a id="nep_call_panel" class="nep_' . $theme . ' nep_'. $position .'" data-emoji-panel="'. $data_settings .'" rel="nofollow noreferrer" title="' . __('Insert Emoji', 'native-emoji') . '"></a>' . "\n";
$fake = "\t" .'<div id="nep_fake_textarea" contenteditable="true" data-emoji-receptor></div>' . "\n";
$replace = "\n" . '<div id="nep_container">' . "\n" . $btn . $fake . "\t" . '<textarea $1 data-emoji-textarea></textarea>'. "\n" .'</div>' . "\n";
$output = preg_replace('/<textarea\s(.*?)><\/textarea>/', $replace, $field);
return $output;
}
// Install the plugin
function nep_emoji_install() {
// Required files
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
// Create Frecuently Used Table
global $wpdb;
$table = $wpdb->prefix . 'nep_native_emoji';
$charset_collate = $wpdb->get_charset_collate();
$sql = "CREATE TABLE $table (
id mediumint(9) NOT NULL AUTO_INCREMENT,
time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
btn_id varchar(255) NOT NULL,
class varchar(255) NOT NULL,
code varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
uid mediumint(9) NOT NULL,
UNIQUE KEY id (id)
) $charset_collate;";
dbDelta( $sql );
}
// Uninstall the plugin
function nep_emoji_uninstall() {
global $wpdb;
$table = $wpdb->prefix . 'nep_native_emoji';
// Delete Plugin Options
delete_option( 'nep_native_emoji_active' );
delete_option( 'nep_plugin_admin_activation' );
delete_option( 'nep_plugin_close_panel' );
delete_option( 'nep_plugin_comments_activation' );
delete_option( 'nep_plugin_site_use_jquery' );
delete_option( 'nep_plugin_show_on_mobile' );
delete_option( 'nep_plugin_panel_color' );
delete_option( 'nep_plugin_panel_position' );
delete_option( 'nep_plugin_close_panel_comments' );
// Delete Frecuently Used Table
$wpdb->query("DROP TABLE IF EXISTS $table");
}
}
new WP_nep_Native_Emoji();

View File

@@ -0,0 +1,151 @@
<?php
/*
* Plugin Name Native Emoji
* Version 3.0.1
* Author Daniel Brandenburg
*/
?>
<div class="wrap">
<h1><?php _e( 'Native Emoji', 'native-emoji' );?></h1>
<h2 class="nav-tab-wrapper">
<a class="nav-tab nep-nav-tab-right nep-nav-tab-donate" href="//paypal.me/danybranding" target="_blank" rel="noopener noreferrer">
<span class="dashicons dashicons-heart"></span> <?php _e( 'Donate', 'native-emoji' );?>
</a>
<a class="nav-tab nep-nav-tab-right nep-nav-tab-review" href="//wordpress.org/support/plugin/native-emoji/reviews/" target="_blank" rel="noopener noreferrer">
<span class="dashicons dashicons-star-filled"></span> <?php _e( 'Review', 'native-emoji' );?>
</a>
<a class="nav-tab nep-nav-tab-right nep-nav-tab-live-demo" href="//native-emoji.davabuu.net" target="_blank" rel="noopener noreferrer">
<span class="dashicons dashicons-visibility"></span> <?php _e( 'Live Demo', 'native-emoji' );?>
</a>
</h2>
<form method="post" action="options.php">
<?php settings_fields( 'nep_native_emoji_settings' ); ?>
<?php do_settings_sections( 'nep_native_emoji_settings' ); ?>
<table class="form-table">
<tr>
<th scope="row"><?php _e( 'Admin editor', 'native-emoji' );?></th>
<td>
<fieldset>
<legend class="screen-reader-text"><span><?php _e( 'Enable plugin on admin editor', 'native-emoji' );?></span></legend>
<label>
<input type="checkbox" name="nep_plugin_admin_activation" value="1" <?php checked( esc_attr( get_option( 'nep_plugin_admin_activation' ) ), '1', true );?>>
<?php _e( 'Enable', 'native-emoji' );?>
</label>
</fieldset>
</td>
</tr>
<tr>
<th scope="row"><?php _e( 'Other admin editor settings', 'native-emoji' );?></th>
<td>
<fieldset>
<legend class="screen-reader-text"><span><?php _e( 'Close panel after insert an emoji', 'native-emoji' );?></span></legend>
<label>
<input type="checkbox" name="nep_plugin_close_panel" value="1" <?php checked( esc_attr( get_option( 'nep_plugin_close_panel' ) ), 1, true );?>>
<?php _e( 'Close panel after insert an emoji', 'native-emoji' );?>
</label>
</fieldset>
</td>
</tr>
<tr>
<th scope="row" colspan="2"><hr></th>
</tr>
<tr>
<th scope="row"><span class="dashicons dashicons-warning"></span> <?php _e( 'Notices', 'native-emoji' );?></th>
<td>
<p class="description"><?php _e( 'Make sure to check the box if your website uses jQuery, otherwise the plugin may cause errors in your website', 'native-emoji' );?></p>
<p class="description"><?php _e( 'The plugin tries to preserve the css properties of the comments box, in case something has been omitted, use your custom css under the tag', 'native-emoji' );?> <strong>#nep_fake_textarea</strong></p>
</td>
</tr>
<tr>
<th scope="row"><?php _e( 'Front end comments', 'native-emoji' );?></th>
<td>
<fieldset>
<legend class="screen-reader-text"><span><?php _e( 'Enable plugin on front end comments', 'native-emoji' );?></span></legend>
<label for="users_can_register">
<input type="checkbox" name="nep_plugin_comments_activation" value="1" <?php checked( esc_attr( get_option( 'nep_plugin_comments_activation' ) ), '1', true );?>>
<?php _e( 'Enable', 'native-emoji' );?>
</label>
</fieldset>
</td>
</tr>
<tr>
<th scope="row"><?php _e( 'Other comments settings', 'native-emoji' );?></th>
<td>
<fieldset>
<legend class="screen-reader-text"><span><?php _e( 'Does your website uses jQuery library?', 'native-emoji' );?></span></legend>
<label for="users_can_register">
<input type="checkbox" name="nep_plugin_site_use_jquery" value="1" <?php checked( esc_attr( get_option( 'nep_plugin_site_use_jquery' ) ), '1', true );?>>
<?php _e( 'My website uses jQuery library', 'native-emoji' );?>
</label>
</fieldset>
<br>
<fieldset>
<legend class="screen-reader-text"><span><?php _e( 'Do you want to display the plugin on mobile devices?', 'native-emoji' );?></span></legend>
<label for="users_can_register">
<input type="checkbox" name="nep_plugin_show_on_mobile" value="1" <?php checked( esc_attr( get_option( 'nep_plugin_show_on_mobile' ) ), 1, true );?>>
<?php _e( 'Display on mobile devices', 'native-emoji' );?>
</label>
</fieldset>
<br>
<fieldset>
<legend class="screen-reader-text"><span><?php _e( 'Close panel after insert an emoji', 'native-emoji' );?></span></legend>
<label>
<input type="checkbox" name="nep_plugin_close_panel_comments" value="1" <?php checked( esc_attr( get_option( 'nep_plugin_close_panel_comments' ) ), 1, true );?>>
<?php _e( 'Close panel after insert an emoji', 'native-emoji' );?>
</label>
</fieldset>
<br>
<fieldset>
<legend class="screen-reader-text"><span><?php _e( 'Comments emoji panel color', 'native-emoji' );?></span></legend>
<label><strong><?php _e( 'Panel color', 'native-emoji' );?></strong></label>
<br>
<label>
<input type="radio" name="nep_plugin_panel_color" value="light" <?php checked( esc_attr( get_option( 'nep_plugin_panel_color', 'light' ) ), 'light', true );?>>
<?php _e('Light', 'native-emoji');?>
</label>
<br>
<label>
<input type="radio" name="nep_plugin_panel_color" value="dark" <?php checked( esc_attr( get_option( 'nep_plugin_panel_color' ) ), 'dark', true );?>>
<?php _e( 'Dark', 'native-emoji' );?>
</label>
</fieldset>
<fieldset>
<legend class="screen-reader-text"><span><?php _e('Comments emoji panel position', 'native-emoji');?></span></legend>
<label><strong><?php _e( 'Panel position', 'native-emoji' );?></strong></label>
<br>
<label>
<input type="radio" name="nep_plugin_panel_position" value="right_bottom" <?php checked( esc_attr( get_option( 'nep_plugin_panel_position', 'right_bottom' ) ), 'right_bottom', true );?>>
<?php _e('Right Bottom', 'native-emoji');?>
</label>
<br>
<label>
<input type="radio" name="nep_plugin_panel_position" value="right_top" <?php checked( esc_attr( get_option( 'nep_plugin_panel_position' ) ), 'right_top', true );?>>
<?php _e( 'Right Top', 'native-emoji' );?>
</label>
<br>
<label>
<input type="radio" name="nep_plugin_panel_position" value="left_bottom" <?php checked( esc_attr( get_option( 'nep_plugin_panel_position' ) ), 'left_bottom', true );?>>
<?php _e( 'Left Bottom', 'native-emoji' );?>
</label>
<br>
<label>
<input type="radio" name="nep_plugin_panel_position" value="left_top" <?php checked( esc_attr( get_option( 'nep_plugin_panel_position' ) ), 'left_top', true );?>>
<?php _e( 'Left Top', 'native-emoji' );?>
</label>
</fieldset>
</td>
</tr>
</table>
<?php submit_button(); ?>
</form>
</div>

View File

@@ -0,0 +1,118 @@
=== Native Emoji ===
Contributors: davabuu
Tags: emoji, emoticons, icons, emoji comments, comments, content, editor, native emoji, TinyMCE
Requires at least: 4.2
Tested up to: 4.9.6
Stable tag: 3.0.1
License: GPLv2 or later
Insert emojis in your posts, pages, custom post types, and comments
== Description ==
This is not just a plugin, this is the plugin for use emoji in a native way in your posts and comments. When activated you will see a new button in your wordpress editor or comments box, from there you will be able to include more than 2,000 emojis.
If the Operative System doesn't support emoji, this plugin insert an image instead of the emoji code.
= Features =
* Very Easy To Use
* More Than 2,000 emojis
* Supports Any Theme
* Supports Custom Posts Types
* Supports Front End Comments
* iOS Native Emoji
* Android Native Emoji
See a live working demo [here](http://native-emoji.davabuu.net/)
If you like this plugin, please [leave a review](https://wordpress.org/support/view/plugin-reviews/native-emoji)
== Installation ==
= Update to 3.1 =
1. Visit 'Plugins > Update Native Emoji'
2. Go To Plugin Settings and select your desired options
3. If somethig looks weird after update clear your browser cache
4. Visit Any post type from your admin and click on the smiley button in the editor
5. Visit Any page/post with a comments box
= From your WordPress dashboard =
1. Visit 'Plugins > Add New'
2. Search for 'Native Emoji'
3. Activate Native Emoji from your Plugins page.
4. Go To Plugin Settings and select your desired options
5. If somethig looks weird after update clear your browser cache
6. Visit Any post type from your admin and click on the smiley button in the editor
7. Visit Any page/post with a comments box
= From WordPress.org =
1. Download Native Emoji.
2. Upload the 'Native Emoji' directory to your '/wp-content/plugins/' directory, using your favorite method (ftp, sftp, scp, etc...)
3. Activate Native Emoji from your Plugins page.
4. Go To Plugin Settings and select your desired options
5. If somethig looks weird after update clear your browser cache
6. Visit Any post type from your admin and click on the smiley button in the editor
7. Visit Any page/post with a comments box
== Screenshots ==
1. Plugin working admin editor
2. Plugin working admin editor
3. Plugin working admin editor
4. Plugin working on Twenty Seventeen theme
5. Plugin working on Twenty Sixteen theme
6. Comments working on Mesmerize theme
7. Comments working on Sydney theme
8. Dark Comments Template
9. Settings Page
== Changelog ==
= 3.0.1 =
*Release Date - 24 June 2018*
* Minor bugs fixed
= 3.0 =
*Release Date - 18 December 2017*
* New Design
* Front End Comments Support
* Settings Page
* New Emojis Added
* Emoji Skin Tone Picker
= 2.0.2 =
*Release Date - 26 June 2016*
* Translation support added
* Minor Bug Fixes
= 2.0.1 =
*Release Date - 24 June 2016*
* Minor Bug Fixes
= 2.0 =
*Release Date - 24 June 2016*
* Minor Bug Fixes
* New Design
* New Emojis Added
* Category Frequently Used Added
* Reordered Categories
= 1.0 =
*Release Date - 1 July 2015*
* Hello World!
== Donate ==
Believe it or not, there is a lot of work behind the plugins and themes we develop. We do not want that in the future we have to make them premium is why we ask your support with a small contribution; this will motivate us to further develop themes and plugins that are free.
[Donate](https://paypal.me/danybranding) and support the development of free plugins like this