Version Description
- new option to set the rate limit for sending mails using the mail form
- added home url as fallback for share count requests
- added further anti-spam prevention mechanics
- added noopener and noreferrer to share links
- fixed double encoding of share count request links
- updated media uploader request for translation
- updated handling of admin notices following WordPress core
- tested and optimized for WordPress 4.6
Download this release
Release Info
Developer | starguide |
Plugin | Shariff Wrapper |
Version | 4.2.0 |
Comparing to | |
See all releases |
Code changes from version 4.1.2 to 4.2.0
- admin/admin_menu.php +256 -263
- admin/admin_notices.php +60 -67
- css/shariff.css +1 -0
- css/shariff.min.css +1 -1
- css/shariff_admin-notice.css +0 -3
- css/shariff_options.css +0 -86
- css/style.css +0 -293
- js/shariff-media.js +20 -0
- js/shariff-notice.js +9 -0
- readme.txt +13 -3
- shariff.php +207 -166
- uninstall.php +18 -39
- updates.php +37 -36
admin/admin_menu.php
CHANGED
@@ -1,8 +1,5 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
* Will be included in the shariff.php only, when an admin is logged in.
|
4 |
-
* Everything reagarding the admin menu was moved to this file.
|
5 |
-
*/
|
6 |
|
7 |
// prevent direct calls to admin_menu.php
|
8 |
if ( ! class_exists('WP') ) { die(); }
|
@@ -14,15 +11,16 @@ add_action( 'init', 'shariff_init_locale' );
|
|
14 |
|
15 |
// scripts and styles for admin pages e.g. info notice
|
16 |
function shariff3UU_admin_style( $hook ) {
|
17 |
-
//
|
18 |
-
|
19 |
-
//
|
20 |
if ( $hook == 'settings_page_shariff3uu' ) {
|
21 |
-
// styles for our plugin options page
|
22 |
-
wp_enqueue_style( 'shariff_options', plugins_url( '../css/shariff_options.css', __FILE__ ) );
|
23 |
// scripts for pinterest default image media uploader
|
24 |
-
wp_enqueue_script( 'jquery' ); // just in case
|
25 |
wp_enqueue_media();
|
|
|
|
|
|
|
|
|
26 |
}
|
27 |
}
|
28 |
add_action( 'admin_enqueue_scripts', 'shariff3UU_admin_style' );
|
@@ -45,7 +43,7 @@ function shariff3UU_options_init(){
|
|
45 |
'shariff3UU_basic_section_callback', 'basic' );
|
46 |
|
47 |
// services
|
48 |
-
add_settings_field( 'shariff3UU_text_services', '<div
|
49 |
'shariff3UU_text_services_render', 'basic', 'shariff3UU_basic_section' );
|
50 |
|
51 |
// add after
|
@@ -74,7 +72,7 @@ function shariff3UU_options_init(){
|
|
74 |
'shariff3UU_design_section_callback', 'design' );
|
75 |
|
76 |
// button language
|
77 |
-
add_settings_field( 'shariff3UU_select_language', '<div
|
78 |
'shariff3UU_select_language_render', 'design', 'shariff3UU_design_section' );
|
79 |
|
80 |
// theme
|
@@ -136,7 +134,7 @@ function shariff3UU_options_init(){
|
|
136 |
|
137 |
// info url
|
138 |
add_settings_field(
|
139 |
-
'shariff3UU_text_info_url', '<div
|
140 |
'shariff3UU_text_info_url_render', 'advanced', 'shariff3UU_advanced_section' );
|
141 |
|
142 |
// twitter via
|
@@ -193,38 +191,43 @@ function shariff3UU_options_init(){
|
|
193 |
|
194 |
// disable mailform
|
195 |
add_settings_field(
|
196 |
-
'shariff3UU_checkbox_disable_mailform', '<div
|
197 |
'shariff3UU_checkbox_disable_mailform_render', 'mailform', 'shariff3UU_mailform_section' );
|
198 |
|
199 |
// require sender e-mail address
|
200 |
add_settings_field(
|
201 |
-
'shariff3UU_checkbox_require_sender',
|
202 |
'shariff3UU_checkbox_require_sender_render', 'mailform', 'shariff3UU_mailform_section' );
|
203 |
|
204 |
// mailform language
|
205 |
add_settings_field(
|
206 |
-
'shariff3UU_select_mailform_language',
|
207 |
'shariff3UU_select_mailform_language_render', 'mailform', 'shariff3UU_mailform_section' );
|
208 |
|
209 |
// add content of the post to e-mails
|
210 |
add_settings_field(
|
211 |
-
'shariff3UU_checkbox_mail_add_post_content',
|
212 |
'shariff3UU_checkbox_mail_add_post_content_render', 'mailform', 'shariff3UU_mailform_section' );
|
213 |
|
214 |
// mail sender name
|
215 |
add_settings_field(
|
216 |
-
'shariff3UU_text_mail_sender_name',
|
217 |
'shariff3UU_text_mail_sender_name_render', 'mailform', 'shariff3UU_mailform_section' );
|
218 |
|
219 |
// mail sender address
|
220 |
add_settings_field(
|
221 |
-
'shariff3UU_text_mail_sender_from',
|
222 |
'shariff3UU_text_mail_sender_from_render', 'mailform', 'shariff3UU_mailform_section' );
|
223 |
|
224 |
// use anchor
|
225 |
add_settings_field(
|
226 |
-
'shariff3UU_checkbox_mailform_anchor',
|
227 |
'shariff3UU_checkbox_mailform_anchor_render', 'mailform', 'shariff3UU_mailform_section' );
|
|
|
|
|
|
|
|
|
|
|
228 |
|
229 |
// fifth tab - statistic
|
230 |
|
@@ -236,47 +239,47 @@ function shariff3UU_options_init(){
|
|
236 |
'shariff3UU_statistic_section_callback', 'statistic' );
|
237 |
|
238 |
// statistic
|
239 |
-
add_settings_field( 'shariff3UU_checkbox_backend', '<div
|
240 |
'shariff3UU_checkbox_backend_render', 'statistic', 'shariff3UU_statistic_section' );
|
241 |
|
242 |
// share counts
|
243 |
-
add_settings_field( 'shariff3UU_checkbox_sharecounts',
|
244 |
'shariff3UU_checkbox_sharecounts_render', 'statistic', 'shariff3UU_statistic_section' );
|
245 |
|
246 |
// Facebook App ID
|
247 |
-
add_settings_field( 'shariff3UU_text_fb_id',
|
248 |
'shariff3UU_text_fb_id_render', 'statistic', 'shariff3UU_statistic_section' );
|
249 |
|
250 |
// Facebook App Secret
|
251 |
-
add_settings_field( 'shariff3UU_text_fb_secret',
|
252 |
'shariff3UU_text_fb_secret_render', 'statistic', 'shariff3UU_statistic_section' );
|
253 |
|
254 |
// autoamtic cache
|
255 |
-
add_settings_field( 'shariff3UU_checkbox_automaticcache',
|
256 |
'shariff3UU_checkbox_automaticcache_render', 'statistic', 'shariff3UU_statistic_section' );
|
257 |
|
258 |
// ranking
|
259 |
-
add_settings_field( 'shariff3UU_number_ranking',
|
260 |
'shariff3UU_number_ranking_render', 'statistic', 'shariff3UU_statistic_section' );
|
261 |
|
262 |
// ttl
|
263 |
-
add_settings_field( 'shariff3UU_number_ttl',
|
264 |
'shariff3UU_number_ttl_render', 'statistic', 'shariff3UU_statistic_section' );
|
265 |
|
266 |
// disable services
|
267 |
-
add_settings_field( 'shariff3UU_multiplecheckbox_disable_services',
|
268 |
'shariff3UU_multiplecheckbox_disable_services_render', 'statistic', 'shariff3UU_statistic_section' );
|
269 |
|
270 |
// external hosts
|
271 |
-
add_settings_field( 'shariff3UU_text_external_host',
|
272 |
'shariff3UU_text_external_host_render', 'statistic', 'shariff3UU_statistic_section' );
|
273 |
|
274 |
// request external api directly from js
|
275 |
-
add_settings_field( 'shariff3UU_checkbox_external_direct',
|
276 |
'shariff3UU_checkbox_external_direct_render', 'statistic', 'shariff3UU_statistic_section' );
|
277 |
|
278 |
// wp in subfolder and api only reachable there?
|
279 |
-
add_settings_field( 'shariff3UU_checkbox_subapi',
|
280 |
'shariff3UU_checkbox_subapi_render', 'statistic', 'shariff3UU_statistic_section' );
|
281 |
|
282 |
// sixth tab - help
|
@@ -375,6 +378,11 @@ function shariff3UU_mailform_sanitize( $input ) {
|
|
375 |
if ( isset( $input["mail_sender_name"] ) ) $valid["mail_sender_name"] = sanitize_text_field( $input["mail_sender_name"] );
|
376 |
if ( isset( $input["mail_sender_from"] ) && is_email( $input["mail_sender_from"] ) != false ) $valid["mail_sender_from"] = sanitize_email( $input["mail_sender_from"] );
|
377 |
if ( isset( $input["mailform_anchor"] ) ) $valid["mailform_anchor"] = absint( $input["mailform_anchor"] );
|
|
|
|
|
|
|
|
|
|
|
378 |
|
379 |
// remove empty elements
|
380 |
$valid = array_filter( $valid );
|
@@ -576,12 +584,12 @@ function shariff3UU_radio_theme_render() {
|
|
576 |
$options = $GLOBALS["shariff3UU_design"];
|
577 |
if ( ! isset( $options["theme"] ) ) $options["theme"] = "";
|
578 |
$plugins_url = plugins_url();
|
579 |
-
echo '<div
|
580 |
-
<div
|
581 |
-
<div
|
582 |
-
<div
|
583 |
-
<div
|
584 |
-
<div
|
585 |
</div>';
|
586 |
}
|
587 |
|
@@ -641,29 +649,25 @@ function shariff3UU_checkbox_vertical_render() {
|
|
641 |
$plugins_url = plugins_url();
|
642 |
echo '<input type="checkbox" name="shariff3UU_design[vertical]" ';
|
643 |
if ( isset( $GLOBALS["shariff3UU_design"]["vertical"] ) ) echo checked( $GLOBALS["shariff3UU_design"]["vertical"], 1, 0 );
|
644 |
-
echo ' value="1"
|
645 |
}
|
646 |
|
647 |
// alignment
|
648 |
function shariff3UU_radio_align_render() {
|
649 |
$options = $GLOBALS['shariff3UU_design'];
|
650 |
if ( ! isset( $options['align'] ) ) $options['align'] = 'flex-start';
|
651 |
-
echo '<
|
652 |
-
<
|
653 |
-
<
|
654 |
-
<div class="shariff_options-cell"><input type="radio" name="shariff3UU_design[align]" value="flex-end" ' . checked( $options["align"], "flex-end", 0 ) . '>' . __( "right", "shariff" ) . '</div>
|
655 |
-
</div></div>';
|
656 |
}
|
657 |
|
658 |
// alignment widget
|
659 |
function shariff3UU_radio_align_widget_render() {
|
660 |
$options = $GLOBALS['shariff3UU_design'];
|
661 |
if ( ! isset( $options['align_widget'] ) ) $options['align_widget'] = 'flex-start';
|
662 |
-
echo '<
|
663 |
-
<
|
664 |
-
<
|
665 |
-
<div class="shariff_options-cell"><input type="radio" name="shariff3UU_design[align_widget]" value="flex-end" ' . checked( $options["align_widget"], "flex-end", 0 ) . '>' . __( "right", "shariff" ) . '</div>
|
666 |
-
</div></div>';
|
667 |
}
|
668 |
|
669 |
// headline
|
@@ -806,29 +810,7 @@ function shariff3UU_text_rssfeed_render() {
|
|
806 |
function shariff3UU_text_default_pinterest_render() {
|
807 |
$options = $GLOBALS["shariff3UU_advanced"];
|
808 |
if ( ! isset( $options["default_pinterest"] ) ) $options["default_pinterest"] = '';
|
809 |
-
echo '<div><input type="text" name="shariff3UU_advanced[default_pinterest]" value="' . $options["default_pinterest"] . '" id="
|
810 |
-
echo '<script type="text/javascript">
|
811 |
-
jQuery(document).ready(function($){
|
812 |
-
$("#upload-btn").click(function(e) {
|
813 |
-
e.preventDefault();
|
814 |
-
var image = wp.media({
|
815 |
-
title: "Choose image",
|
816 |
-
// mutiple: true if you want to upload multiple files at once
|
817 |
-
multiple: false
|
818 |
-
}).open()
|
819 |
-
.on("select", function(e){
|
820 |
-
// This will return the selected image from the Media Uploader, the result is an object
|
821 |
-
var uploaded_image = image.state().get("selection").first();
|
822 |
-
// We convert uploaded_image to a JSON object to make accessing it easier
|
823 |
-
// Output to the console uploaded_image
|
824 |
-
console.log(uploaded_image);
|
825 |
-
var image_url = uploaded_image.toJSON().url;
|
826 |
-
// Let"s assign the url value to the input field
|
827 |
-
$("#image_url").val(image_url);
|
828 |
-
});
|
829 |
-
});
|
830 |
-
});
|
831 |
-
</script>';
|
832 |
}
|
833 |
|
834 |
// shortcodeprio
|
@@ -925,6 +907,17 @@ function shariff3UU_checkbox_mailform_anchor_render() {
|
|
925 |
echo ' value="1">';
|
926 |
}
|
927 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
928 |
// statistic section
|
929 |
|
930 |
// description statistic options
|
@@ -1136,198 +1129,198 @@ function shariff3UU_help_section_callback() {
|
|
1136 |
echo __( 'This is a list of all available options for the <code>[shariff]</code> shortcode:', 'shariff' );
|
1137 |
echo '</p>';
|
1138 |
// shortcode table
|
1139 |
-
echo '<div
|
1140 |
// head
|
1141 |
-
echo '<div
|
1142 |
-
echo '<div
|
1143 |
-
echo '<div
|
1144 |
-
echo '<div
|
1145 |
-
echo '<div
|
1146 |
-
echo '<div
|
1147 |
echo '</div>';
|
1148 |
// services
|
1149 |
-
echo '<div
|
1150 |
-
echo '<div
|
1151 |
-
echo '<div
|
1152 |
-
echo '<div
|
1153 |
-
echo '<div
|
1154 |
-
echo '<div
|
1155 |
echo '</div>';
|
1156 |
// backend
|
1157 |
-
echo '<div
|
1158 |
-
echo '<div
|
1159 |
-
echo '<div
|
1160 |
-
echo '<div
|
1161 |
-
echo '<div
|
1162 |
-
echo '<div
|
1163 |
echo '</div>';
|
1164 |
// theme
|
1165 |
-
echo '<div
|
1166 |
-
echo '<div
|
1167 |
-
echo '<div
|
1168 |
-
echo '<div
|
1169 |
-
echo '<div
|
1170 |
-
echo '<div
|
1171 |
echo '</div>';
|
1172 |
// button size
|
1173 |
-
echo '<div
|
1174 |
-
echo '<div
|
1175 |
-
echo '<div
|
1176 |
-
echo '<div
|
1177 |
-
echo '<div
|
1178 |
-
echo '<div
|
1179 |
echo '</div>';
|
1180 |
// buttonstretch
|
1181 |
-
echo '<div
|
1182 |
-
echo '<div
|
1183 |
-
echo '<div
|
1184 |
-
echo '<div
|
1185 |
-
echo '<div
|
1186 |
-
echo '<div
|
1187 |
echo '</div>';
|
1188 |
// borderradius
|
1189 |
-
echo '<div
|
1190 |
-
echo '<div
|
1191 |
-
echo '<div
|
1192 |
-
echo '<div
|
1193 |
-
echo '<div
|
1194 |
-
echo '<div
|
1195 |
echo '</div>';
|
1196 |
// maincolor
|
1197 |
-
echo '<div
|
1198 |
-
echo '<div
|
1199 |
-
echo '<div
|
1200 |
-
echo '<div
|
1201 |
-
echo '<div
|
1202 |
-
echo '<div
|
1203 |
echo '</div>';
|
1204 |
// secondarycolor
|
1205 |
-
echo '<div
|
1206 |
-
echo '<div
|
1207 |
-
echo '<div
|
1208 |
-
echo '<div
|
1209 |
-
echo '<div
|
1210 |
-
echo '<div
|
1211 |
echo '</div>';
|
1212 |
// orientation
|
1213 |
-
echo '<div
|
1214 |
-
echo '<div
|
1215 |
-
echo '<div
|
1216 |
-
echo '<div
|
1217 |
-
echo '<div
|
1218 |
-
echo '<div
|
1219 |
echo '</div>';
|
1220 |
// alignment
|
1221 |
-
echo '<div
|
1222 |
-
echo '<div
|
1223 |
-
echo '<div
|
1224 |
-
echo '<div
|
1225 |
-
echo '<div
|
1226 |
-
echo '<div
|
1227 |
echo '</div>';
|
1228 |
// language
|
1229 |
-
echo '<div
|
1230 |
-
echo '<div
|
1231 |
-
echo '<div
|
1232 |
-
echo '<div
|
1233 |
-
echo '<div
|
1234 |
-
echo '<div
|
1235 |
echo '</div>';
|
1236 |
// headline
|
1237 |
-
echo '<div
|
1238 |
-
echo '<div
|
1239 |
-
echo '<div
|
1240 |
-
echo '<div
|
1241 |
-
echo '<div
|
1242 |
-
echo '<div
|
1243 |
echo '</div>';
|
1244 |
// twitter_via
|
1245 |
-
echo '<div
|
1246 |
-
echo '<div
|
1247 |
-
echo '<div
|
1248 |
-
echo '<div
|
1249 |
-
echo '<div
|
1250 |
-
echo '<div
|
1251 |
echo '</div>';
|
1252 |
// flattruser
|
1253 |
-
echo '<div
|
1254 |
-
echo '<div
|
1255 |
-
echo '<div
|
1256 |
-
echo '<div
|
1257 |
-
echo '<div
|
1258 |
-
echo '<div
|
1259 |
echo '</div>';
|
1260 |
// patreonid
|
1261 |
-
echo '<div
|
1262 |
-
echo '<div
|
1263 |
-
echo '<div
|
1264 |
-
echo '<div
|
1265 |
-
echo '<div
|
1266 |
-
echo '<div
|
1267 |
echo '</div>';
|
1268 |
// paypalbuttonid
|
1269 |
-
echo '<div
|
1270 |
-
echo '<div
|
1271 |
-
echo '<div
|
1272 |
-
echo '<div
|
1273 |
-
echo '<div
|
1274 |
-
echo '<div
|
1275 |
echo '</div>';
|
1276 |
// paypalmeid
|
1277 |
-
echo '<div
|
1278 |
-
echo '<div
|
1279 |
-
echo '<div
|
1280 |
-
echo '<div
|
1281 |
-
echo '<div
|
1282 |
-
echo '<div
|
1283 |
echo '</div>';
|
1284 |
// bitcoinaddress
|
1285 |
-
echo '<div
|
1286 |
-
echo '<div
|
1287 |
-
echo '<div
|
1288 |
-
echo '<div
|
1289 |
-
echo '<div
|
1290 |
-
echo '<div
|
1291 |
echo '</div>';
|
1292 |
// media
|
1293 |
-
echo '<div
|
1294 |
-
echo '<div
|
1295 |
-
echo '<div
|
1296 |
-
echo '<div
|
1297 |
-
echo '<div
|
1298 |
-
echo '<div
|
1299 |
echo '</div>';
|
1300 |
// info_url
|
1301 |
-
echo '<div
|
1302 |
-
echo '<div
|
1303 |
-
echo '<div
|
1304 |
-
echo '<div
|
1305 |
-
echo '<div
|
1306 |
-
echo '<div
|
1307 |
echo '</div>';
|
1308 |
// url
|
1309 |
-
echo '<div
|
1310 |
-
echo '<div
|
1311 |
-
echo '<div
|
1312 |
-
echo '<div
|
1313 |
-
echo '<div
|
1314 |
-
echo '<div
|
1315 |
echo '</div>';
|
1316 |
// title
|
1317 |
-
echo '<div
|
1318 |
-
echo '<div
|
1319 |
-
echo '<div
|
1320 |
-
echo '<div
|
1321 |
-
echo '<div
|
1322 |
-
echo '<div
|
1323 |
echo '</div>';
|
1324 |
// rssfeed
|
1325 |
-
echo '<div
|
1326 |
-
echo '<div
|
1327 |
-
echo '<div
|
1328 |
-
echo '<div
|
1329 |
-
echo '<div
|
1330 |
-
echo '<div
|
1331 |
echo '</div>';
|
1332 |
|
1333 |
echo '</div>';
|
@@ -1340,17 +1333,17 @@ function shariff3UU_status_section_callback() {
|
|
1340 |
$shariff3UU = $GLOBALS["shariff3UU"];
|
1341 |
|
1342 |
// status table
|
1343 |
-
echo '<div
|
1344 |
|
1345 |
// statistic row
|
1346 |
-
echo '<div
|
1347 |
-
echo '<div
|
1348 |
|
1349 |
// check if statistic is enabled
|
1350 |
if ( ! isset( $shariff3UU['backend'] ) ) {
|
1351 |
// statistic disabled message
|
1352 |
-
echo '<div
|
1353 |
-
echo '<div
|
1354 |
echo '</div>';
|
1355 |
// end statistic row, if statistic is disabled
|
1356 |
echo '</div>';
|
@@ -1381,21 +1374,21 @@ function shariff3UU_status_section_callback() {
|
|
1381 |
}
|
1382 |
|
1383 |
// general statistic status
|
1384 |
-
echo '<div
|
1385 |
-
echo '<div
|
1386 |
if ( empty( $service_errors ) ) {
|
1387 |
-
echo '<div
|
1388 |
-
echo '<div
|
1389 |
}
|
1390 |
elseif ( array_filter( $service_errors ) ) {
|
1391 |
-
echo '<div
|
1392 |
-
echo '<div
|
1393 |
}
|
1394 |
else {
|
1395 |
-
echo '<div
|
1396 |
-
echo '<div
|
1397 |
}
|
1398 |
-
echo '<div
|
1399 |
echo '</div>';
|
1400 |
echo '</div>';
|
1401 |
|
@@ -1405,30 +1398,30 @@ function shariff3UU_status_section_callback() {
|
|
1405 |
// output all services
|
1406 |
foreach( $services as $service ) {
|
1407 |
// service row
|
1408 |
-
echo '<div
|
1409 |
echo '<div class="shariff_status-first-cell">' . ucfirst( $service ) . ':</div>';
|
1410 |
-
echo '<div
|
1411 |
echo '<div class="shariff_status-table">';
|
1412 |
if ( isset ( $shariff3UU["disable"][$service] ) && $shariff3UU["disable"][$service] == '1' ) {
|
1413 |
-
echo '<div
|
1414 |
}
|
1415 |
elseif ( ! array_key_exists( $service, $service_errors ) ) {
|
1416 |
-
echo '<div
|
1417 |
-
echo '<div
|
1418 |
}
|
1419 |
elseif ( empty( $service_errors[$service] ) ) {
|
1420 |
-
echo '<div
|
1421 |
-
echo '<div
|
1422 |
echo __( 'Service didn\'t respond in less than five seconds.', 'shariff' );
|
1423 |
echo '</div></div>';
|
1424 |
}
|
1425 |
else {
|
1426 |
-
echo '<div
|
1427 |
-
echo '<div
|
1428 |
echo $service_errors[$service];
|
1429 |
echo '</div></div>';
|
1430 |
}
|
1431 |
-
echo '<div
|
1432 |
echo '</div>';
|
1433 |
echo '</div>';
|
1434 |
echo '</div>';
|
@@ -1436,23 +1429,23 @@ function shariff3UU_status_section_callback() {
|
|
1436 |
}
|
1437 |
|
1438 |
// GD needed for QR codes of the Bitcoin links
|
1439 |
-
echo '<div
|
1440 |
-
echo '<div
|
1441 |
// working message
|
1442 |
if ( function_exists( 'gd_info' ) ) {
|
1443 |
$tmpGDinfo = gd_info();
|
1444 |
-
echo '<div
|
1445 |
echo '<div style="display: table">';
|
1446 |
-
echo '<div
|
1447 |
-
echo '<div
|
1448 |
echo '</div>';
|
1449 |
echo '</div>';
|
1450 |
}
|
1451 |
else {
|
1452 |
-
echo '<div
|
1453 |
echo '<div style="display: table">';
|
1454 |
-
echo '<div
|
1455 |
-
echo '<div
|
1456 |
echo '</div>';
|
1457 |
echo '</div>';
|
1458 |
}
|
@@ -1534,32 +1527,32 @@ function shariff3UU_ranking_section_callback() {
|
|
1534 |
}
|
1535 |
|
1536 |
// ranking table
|
1537 |
-
echo '<div
|
1538 |
// head
|
1539 |
-
echo '<div
|
1540 |
-
echo '<div
|
1541 |
-
echo '<div
|
1542 |
-
echo '<div
|
1543 |
-
echo '<div
|
1544 |
-
foreach( $services as $service => $nothing ) echo '<div
|
1545 |
-
echo '<div
|
1546 |
echo '</div>';
|
1547 |
// posts
|
1548 |
$rank = '0';
|
1549 |
foreach( $posts as $post => $value ) {
|
1550 |
$rank++;
|
1551 |
-
echo '<div
|
1552 |
-
echo '<div
|
1553 |
-
echo '<div
|
1554 |
-
echo '<div
|
1555 |
-
echo '<div
|
1556 |
// share counts
|
1557 |
foreach( $services as $service => $nothing ) {
|
1558 |
-
echo '<div
|
1559 |
if( isset( $value['share_counts'][$service] ) ) echo $value['share_counts'][$service];
|
1560 |
echo '</div>';
|
1561 |
}
|
1562 |
-
echo '<div
|
1563 |
if ( isset( $value['share_counts']['total'] ) ) echo $value['share_counts']['total'];
|
1564 |
echo '</div>';
|
1565 |
echo '</div>';
|
1 |
<?php
|
2 |
+
// Will be included in the shariff.php only, when an admin is logged in.
|
|
|
|
|
|
|
3 |
|
4 |
// prevent direct calls to admin_menu.php
|
5 |
if ( ! class_exists('WP') ) { die(); }
|
11 |
|
12 |
// scripts and styles for admin pages e.g. info notice
|
13 |
function shariff3UU_admin_style( $hook ) {
|
14 |
+
// js for admin notice - needed on _ALL_ admin pages (as long as WordPress does not handle dismiss clicks)
|
15 |
+
wp_enqueue_script( 'shariff_notice', plugins_url( '../js/shariff-notice.js', __FILE__ ), array( 'jquery' ), '1.0', true );
|
16 |
+
// scripts only needed on our plugin options page - no need to load them on _ALL_ admin pages
|
17 |
if ( $hook == 'settings_page_shariff3uu' ) {
|
|
|
|
|
18 |
// scripts for pinterest default image media uploader
|
|
|
19 |
wp_enqueue_media();
|
20 |
+
wp_register_script( 'shariff_mediaupload', plugins_url( '../js/shariff-media.js', __FILE__ ), array( 'jquery' ), '1.0', true );
|
21 |
+
$translation_array = array( 'choose_image' => __( 'Choose image', 'shariff' ) );
|
22 |
+
wp_localize_script( 'shariff_mediaupload', 'shariff_media', $translation_array );
|
23 |
+
wp_enqueue_script( 'shariff_mediaupload' );
|
24 |
}
|
25 |
}
|
26 |
add_action( 'admin_enqueue_scripts', 'shariff3UU_admin_style' );
|
43 |
'shariff3UU_basic_section_callback', 'basic' );
|
44 |
|
45 |
// services
|
46 |
+
add_settings_field( 'shariff3UU_text_services', '<div style="width:450px">' . __( 'Enable the following services in the provided order:', 'shariff' ) . '</div>',
|
47 |
'shariff3UU_text_services_render', 'basic', 'shariff3UU_basic_section' );
|
48 |
|
49 |
// add after
|
72 |
'shariff3UU_design_section_callback', 'design' );
|
73 |
|
74 |
// button language
|
75 |
+
add_settings_field( 'shariff3UU_select_language', '<div style="width:450px">' . __( 'Shariff button language:', 'shariff' ) . '</div>',
|
76 |
'shariff3UU_select_language_render', 'design', 'shariff3UU_design_section' );
|
77 |
|
78 |
// theme
|
134 |
|
135 |
// info url
|
136 |
add_settings_field(
|
137 |
+
'shariff3UU_text_info_url', '<div style="width:450px">' . __( 'Custom link for the info button:', 'shariff' ) . '</div>',
|
138 |
'shariff3UU_text_info_url_render', 'advanced', 'shariff3UU_advanced_section' );
|
139 |
|
140 |
// twitter via
|
191 |
|
192 |
// disable mailform
|
193 |
add_settings_field(
|
194 |
+
'shariff3UU_checkbox_disable_mailform', '<div style="width:450px">' . __( 'Disable the mail form functionality.', 'shariff' ) . '</div>',
|
195 |
'shariff3UU_checkbox_disable_mailform_render', 'mailform', 'shariff3UU_mailform_section' );
|
196 |
|
197 |
// require sender e-mail address
|
198 |
add_settings_field(
|
199 |
+
'shariff3UU_checkbox_require_sender', __( 'Require sender e-mail address.', 'shariff' ),
|
200 |
'shariff3UU_checkbox_require_sender_render', 'mailform', 'shariff3UU_mailform_section' );
|
201 |
|
202 |
// mailform language
|
203 |
add_settings_field(
|
204 |
+
'shariff3UU_select_mailform_language', __( 'Mailform language:', 'shariff' ),
|
205 |
'shariff3UU_select_mailform_language_render', 'mailform', 'shariff3UU_mailform_section' );
|
206 |
|
207 |
// add content of the post to e-mails
|
208 |
add_settings_field(
|
209 |
+
'shariff3UU_checkbox_mail_add_post_content', __( 'Add the post content to the e-mail body.', 'shariff' ),
|
210 |
'shariff3UU_checkbox_mail_add_post_content_render', 'mailform', 'shariff3UU_mailform_section' );
|
211 |
|
212 |
// mail sender name
|
213 |
add_settings_field(
|
214 |
+
'shariff3UU_text_mail_sender_name', __( 'Default sender name:', 'shariff' ),
|
215 |
'shariff3UU_text_mail_sender_name_render', 'mailform', 'shariff3UU_mailform_section' );
|
216 |
|
217 |
// mail sender address
|
218 |
add_settings_field(
|
219 |
+
'shariff3UU_text_mail_sender_from', __( 'Default sender e-mail address:', 'shariff' ),
|
220 |
'shariff3UU_text_mail_sender_from_render', 'mailform', 'shariff3UU_mailform_section' );
|
221 |
|
222 |
// use anchor
|
223 |
add_settings_field(
|
224 |
+
'shariff3UU_checkbox_mailform_anchor', __( 'Use an anchor to jump to the mail form.', 'shariff' ),
|
225 |
'shariff3UU_checkbox_mailform_anchor_render', 'mailform', 'shariff3UU_mailform_section' );
|
226 |
+
|
227 |
+
// wait timer
|
228 |
+
add_settings_field(
|
229 |
+
'shariff3UU_number_mailform_wait', __( 'Time to wait until the same IP address is allowed to submit the form again (in seconds):', 'shariff' ),
|
230 |
+
'shariff3UU_number_mailform_wait_render', 'mailform', 'shariff3UU_mailform_section' );
|
231 |
|
232 |
// fifth tab - statistic
|
233 |
|
239 |
'shariff3UU_statistic_section_callback', 'statistic' );
|
240 |
|
241 |
// statistic
|
242 |
+
add_settings_field( 'shariff3UU_checkbox_backend', '<div style="width:450px">' . __( 'Enable statistic.', 'shariff' ) . '</div>',
|
243 |
'shariff3UU_checkbox_backend_render', 'statistic', 'shariff3UU_statistic_section' );
|
244 |
|
245 |
// share counts
|
246 |
+
add_settings_field( 'shariff3UU_checkbox_sharecounts', __( 'Show share counts on buttons.', 'shariff' ),
|
247 |
'shariff3UU_checkbox_sharecounts_render', 'statistic', 'shariff3UU_statistic_section' );
|
248 |
|
249 |
// Facebook App ID
|
250 |
+
add_settings_field( 'shariff3UU_text_fb_id', __( 'Facebook App ID:', 'shariff' ),
|
251 |
'shariff3UU_text_fb_id_render', 'statistic', 'shariff3UU_statistic_section' );
|
252 |
|
253 |
// Facebook App Secret
|
254 |
+
add_settings_field( 'shariff3UU_text_fb_secret', __( 'Facebook App Secret:', 'shariff' ),
|
255 |
'shariff3UU_text_fb_secret_render', 'statistic', 'shariff3UU_statistic_section' );
|
256 |
|
257 |
// autoamtic cache
|
258 |
+
add_settings_field( 'shariff3UU_checkbox_automaticcache', __( 'Fill cache automatically.', 'shariff' ),
|
259 |
'shariff3UU_checkbox_automaticcache_render', 'statistic', 'shariff3UU_statistic_section' );
|
260 |
|
261 |
// ranking
|
262 |
+
add_settings_field( 'shariff3UU_number_ranking', __( 'Number of posts on ranking tab:', 'shariff' ),
|
263 |
'shariff3UU_number_ranking_render', 'statistic', 'shariff3UU_statistic_section' );
|
264 |
|
265 |
// ttl
|
266 |
+
add_settings_field( 'shariff3UU_number_ttl', __( 'Cache TTL in seconds (60 - 7200):', 'shariff' ),
|
267 |
'shariff3UU_number_ttl_render', 'statistic', 'shariff3UU_statistic_section' );
|
268 |
|
269 |
// disable services
|
270 |
+
add_settings_field( 'shariff3UU_multiplecheckbox_disable_services', __( 'Disable the following services (share counts only):', 'shariff' ),
|
271 |
'shariff3UU_multiplecheckbox_disable_services_render', 'statistic', 'shariff3UU_statistic_section' );
|
272 |
|
273 |
// external hosts
|
274 |
+
add_settings_field( 'shariff3UU_text_external_host', __( 'External API for share counts:', 'shariff' ),
|
275 |
'shariff3UU_text_external_host_render', 'statistic', 'shariff3UU_statistic_section' );
|
276 |
|
277 |
// request external api directly from js
|
278 |
+
add_settings_field( 'shariff3UU_checkbox_external_direct', __( 'Request external API directly.', 'shariff' ),
|
279 |
'shariff3UU_checkbox_external_direct_render', 'statistic', 'shariff3UU_statistic_section' );
|
280 |
|
281 |
// wp in subfolder and api only reachable there?
|
282 |
+
add_settings_field( 'shariff3UU_checkbox_subapi', __( 'Local API not reachable in root.', 'shariff' ),
|
283 |
'shariff3UU_checkbox_subapi_render', 'statistic', 'shariff3UU_statistic_section' );
|
284 |
|
285 |
// sixth tab - help
|
378 |
if ( isset( $input["mail_sender_name"] ) ) $valid["mail_sender_name"] = sanitize_text_field( $input["mail_sender_name"] );
|
379 |
if ( isset( $input["mail_sender_from"] ) && is_email( $input["mail_sender_from"] ) != false ) $valid["mail_sender_from"] = sanitize_email( $input["mail_sender_from"] );
|
380 |
if ( isset( $input["mailform_anchor"] ) ) $valid["mailform_anchor"] = absint( $input["mailform_anchor"] );
|
381 |
+
if ( isset( $input["mailform_wait"] ) ) $valid["mailform_wait"] = absint( $input["mailform_wait"] );
|
382 |
+
|
383 |
+
// protect users from themselfs
|
384 |
+
if ( isset( $valid["mailform_wait"] ) && $valid["mailform_wait"] < '5' ) $valid["mailform_wait"] = '';
|
385 |
+
elseif ( isset( $valid["mailform_wait"] ) && $valid["mailform_wait"] > '86400' ) $valid["mailform_wait"] = '86400';
|
386 |
|
387 |
// remove empty elements
|
388 |
$valid = array_filter( $valid );
|
584 |
$options = $GLOBALS["shariff3UU_design"];
|
585 |
if ( ! isset( $options["theme"] ) ) $options["theme"] = "";
|
586 |
$plugins_url = plugins_url();
|
587 |
+
echo '<div style="display:table;border-spacing:10px;margin:-15px 0 -5px -5px;border-collapse: separate">
|
588 |
+
<div style="display:table-row"><div style="display:table-cell;vertical-align:middle;min-width:75px"><input type="radio" name="shariff3UU_design[theme]" value="" ' . checked( $options["theme"], "", 0 ) . '>default</div><div class="shariff_options-cell"><img src="' . $plugins_url . '/shariff/pictos/defaultBtns.png"></div></div>
|
589 |
+
<div style="display:table-row"><div style="display:table-cell;vertical-align:middle;min-width:75px"><input type="radio" name="shariff3UU_design[theme]" value="color" ' . checked( $options["theme"], "color", 0 ) . '>color</div><div class="shariff_options-cell"><img src="' . $plugins_url . '/shariff/pictos/colorBtns.png"></div></div>
|
590 |
+
<div style="display:table-row"><div style="display:table-cell;vertical-align:middle;min-width:75px"><input type="radio" name="shariff3UU_design[theme]" value="grey" ' . checked( $options["theme"], "grey", 0 ) . '>grey</div><div class="shariff_options-cell"><img src="' . $plugins_url . '/shariff/pictos/greyBtns.png"></div></div>
|
591 |
+
<div style="display:table-row"><div style="display:table-cell;vertical-align:middle;min-width:75px"><input type="radio" name="shariff3UU_design[theme]" value="white" ' . checked( $options["theme"], "white", 0 ) . '>white</div><div class="shariff_options-cell"><img src="' . $plugins_url . '/shariff/pictos/whiteBtns.png"></div></div>
|
592 |
+
<div style="display:table-row"><div style="display:table-cell;vertical-align:middle;min-width:75px"><input type="radio" name="shariff3UU_design[theme]" value="round" ' . checked( $options["theme"], "round", 0 ) . '>round</div><div class="shariff_options-cell"><img src="' . $plugins_url . '/shariff/pictos/roundBtns.png"></div></div>
|
593 |
</div>';
|
594 |
}
|
595 |
|
649 |
$plugins_url = plugins_url();
|
650 |
echo '<input type="checkbox" name="shariff3UU_design[vertical]" ';
|
651 |
if ( isset( $GLOBALS["shariff3UU_design"]["vertical"] ) ) echo checked( $GLOBALS["shariff3UU_design"]["vertical"], 1, 0 );
|
652 |
+
echo ' value="1">';
|
653 |
}
|
654 |
|
655 |
// alignment
|
656 |
function shariff3UU_radio_align_render() {
|
657 |
$options = $GLOBALS['shariff3UU_design'];
|
658 |
if ( ! isset( $options['align'] ) ) $options['align'] = 'flex-start';
|
659 |
+
echo '<p><input type="radio" name="shariff3UU_design[align]" value="flex-start" ' . checked( $options["align"], "flex-start", 0 ) . '>' . __( "left", "shariff" ) . '</p>';
|
660 |
+
echo '<p><input type="radio" name="shariff3UU_design[align]" value="center" ' . checked( $options["align"], "center", 0 ) . '>' . __( "center", "shariff" ) . '</p>';
|
661 |
+
echo '<p><input type="radio" name="shariff3UU_design[align]" value="flex-end" ' . checked( $options["align"], "flex-end", 0 ) . '>' . __( "right", "shariff" ) . '</p>';
|
|
|
|
|
662 |
}
|
663 |
|
664 |
// alignment widget
|
665 |
function shariff3UU_radio_align_widget_render() {
|
666 |
$options = $GLOBALS['shariff3UU_design'];
|
667 |
if ( ! isset( $options['align_widget'] ) ) $options['align_widget'] = 'flex-start';
|
668 |
+
echo '<p><input type="radio" name="shariff3UU_design[align_widget]" value="flex-start" ' . checked( $options["align_widget"], "flex-start", 0 ) . '>' . __( "left", "shariff" ) . '</p>';
|
669 |
+
echo '<p><input type="radio" name="shariff3UU_design[align_widget]" value="center" ' . checked( $options["align_widget"], "center", 0 ) . '>' . __( "center", "shariff" ) . '</p>';
|
670 |
+
echo '<p><input type="radio" name="shariff3UU_design[align_widget]" value="flex-end" ' . checked( $options["align_widget"], "flex-end", 0 ) . '>' . __( "right", "shariff" ) . '</p>';
|
|
|
|
|
671 |
}
|
672 |
|
673 |
// headline
|
810 |
function shariff3UU_text_default_pinterest_render() {
|
811 |
$options = $GLOBALS["shariff3UU_advanced"];
|
812 |
if ( ! isset( $options["default_pinterest"] ) ) $options["default_pinterest"] = '';
|
813 |
+
echo '<div><input type="text" name="shariff3UU_advanced[default_pinterest]" value="' . $options["default_pinterest"] . '" id="shariff-image-url" class="regular-text"><input type="button" name="upload-btn" id="shariff-upload-btn" class="button-secondary" value="' . __( 'Choose image', 'shariff' ) . '"></div>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
814 |
}
|
815 |
|
816 |
// shortcodeprio
|
907 |
echo ' value="1">';
|
908 |
}
|
909 |
|
910 |
+
// wait timer
|
911 |
+
function shariff3UU_number_mailform_wait_render() {
|
912 |
+
if ( isset($GLOBALS["shariff3UU_mailform"]["mailform_wait"]) ) {
|
913 |
+
$mailform_wait = $GLOBALS["shariff3UU_mailform"]["mailform_wait"];
|
914 |
+
}
|
915 |
+
else {
|
916 |
+
$mailform_wait = '';
|
917 |
+
}
|
918 |
+
echo '<input type="number" name="shariff3UU_mailform[mailform_wait]" value="'. $mailform_wait .'" maxlength="4" min="5" max="86400" placeholder="5" style="width: 75px">';
|
919 |
+
}
|
920 |
+
|
921 |
// statistic section
|
922 |
|
923 |
// description statistic options
|
1129 |
echo __( 'This is a list of all available options for the <code>[shariff]</code> shortcode:', 'shariff' );
|
1130 |
echo '</p>';
|
1131 |
// shortcode table
|
1132 |
+
echo '<div style="display:table;background-color:#fff">';
|
1133 |
// head
|
1134 |
+
echo '<div style="display:table-row">';
|
1135 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px;font-weight:bold">' . __( 'Name', 'shariff' ) . '</div>';
|
1136 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px;font-weight:bold">' . __( 'Options', 'shariff' ) . '</div>';
|
1137 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px;font-weight:bold">' . __( 'Default', 'shariff' ) . '</div>';
|
1138 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px;font-weight:bold">' . __( 'Example', 'shariff' ) . '</div>';
|
1139 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px;font-weight:bold">' . __( 'Description', 'shariff' ) . '</div>';
|
1140 |
echo '</div>';
|
1141 |
// services
|
1142 |
+
echo '<div style="display:table-row">';
|
1143 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">services</div>';
|
1144 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">facebook<br>twitter<br>googleplus<br>whatsapp<br>threema<br>pinterest<br>linkedin<br>xing<br>reddit<br>stumbleupon<br>tumblr<br>vk<br>diaspora<br>addthis<br>flattr<br>patreon<br>paypal<br>paypalme<br>bitcoin<br>mailform<br>mailto<br>printer<br>info<br>rss</div>';
|
1145 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">twitter|facebook|googleplus|info</div>';
|
1146 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff services="facebook|twitter|mailform"]</div>';
|
1147 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Determines which buttons to show and in which order.', 'shariff' ) . '</div>';
|
1148 |
echo '</div>';
|
1149 |
// backend
|
1150 |
+
echo '<div style="display:table-row">';
|
1151 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">backend</div>';
|
1152 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">on<br>off</div>';
|
1153 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">off</div>';
|
1154 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff backend="on"]</div>';
|
1155 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Enables share counts on the buttons.', 'shariff' ) . '</div>';
|
1156 |
echo '</div>';
|
1157 |
// theme
|
1158 |
+
echo '<div style="display:table-row">';
|
1159 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">theme</div>';
|
1160 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">default<br>color<br>grey<br>white<br>round</div>';
|
1161 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">default</div>';
|
1162 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff theme="round"]</div>';
|
1163 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Determines the main design of the buttons.', 'shariff' ) . '</div>';
|
1164 |
echo '</div>';
|
1165 |
// button size
|
1166 |
+
echo '<div style="display:table-row">';
|
1167 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">buttonsize</div>';
|
1168 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">big<br>small</div>';
|
1169 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">big</div>';
|
1170 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff buttonsize="small"]</div>';
|
1171 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Small reduces the size of all buttons by 30%, regardless of theme.', 'shariff' ) . '</div>';
|
1172 |
echo '</div>';
|
1173 |
// buttonstretch
|
1174 |
+
echo '<div style="display:table-row">';
|
1175 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">buttonstretch</div>';
|
1176 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">0<br>1</div>';
|
1177 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">0</div>';
|
1178 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff buttonstretch="1"]</div>';
|
1179 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Stretch buttons horizontally to full width.', 'shariff' ) . '</div>';
|
1180 |
echo '</div>';
|
1181 |
// borderradius
|
1182 |
+
echo '<div style="display:table-row">';
|
1183 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">borderradius</div>';
|
1184 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">1-50</div>';
|
1185 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">50</div>';
|
1186 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff borderradius="1"]</div>';
|
1187 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Sets the border radius for the round theme. 1 essentially equals a square.', 'shariff' ) . '</div>';
|
1188 |
echo '</div>';
|
1189 |
// maincolor
|
1190 |
+
echo '<div style="display:table-row">';
|
1191 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">maincolor</div>';
|
1192 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
|
1193 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
|
1194 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff maincolor="#000"]</div>';
|
1195 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Sets a custom main color for all buttons (hexadecimal).', 'shariff' ) . '</div>';
|
1196 |
echo '</div>';
|
1197 |
// secondarycolor
|
1198 |
+
echo '<div style="display:table-row">';
|
1199 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">secondarycolor</div>';
|
1200 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
|
1201 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
|
1202 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff secondarycolor="#afafaf"]</div>';
|
1203 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Sets a custom secondary color for all buttons (hexadecimal). The secondary color is, depending on theme, used for hover effects.', 'shariff' ) . '</div>';
|
1204 |
echo '</div>';
|
1205 |
// orientation
|
1206 |
+
echo '<div style="display:table-row">';
|
1207 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">orientation</div>';
|
1208 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">horizontal<br>vertical</div>';
|
1209 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">horizontal</div>';
|
1210 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff orientation="vertical"]</div>';
|
1211 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Changes the orientation of the buttons.', 'shariff' ) . '</div>';
|
1212 |
echo '</div>';
|
1213 |
// alignment
|
1214 |
+
echo '<div style="display:table-row">';
|
1215 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">align</div>';
|
1216 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">flex-start<br>center<br>flex-end</div>';
|
1217 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">flex-start</div>';
|
1218 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff align="center"]</div>';
|
1219 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Changes the horizontal alignment of the buttons. flex-start means left, center is obvious and flex-end means right.', 'shariff' ) . '</div>';
|
1220 |
echo '</div>';
|
1221 |
// language
|
1222 |
+
echo '<div style="display:table-row">';
|
1223 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">language</div>';
|
1224 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">da, de, en, es, fi, fr, hr, hu, it, ja, ko, nl, no, pl, pt, ro, ru, sk, sl, sr, sv, tr, zh</div>';
|
1225 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Automatically selected by browser.', 'shariff' ) . '</div>';
|
1226 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff lang="de"]</div>';
|
1227 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Changes the language of the share buttons.', 'shariff' ) . '</div>';
|
1228 |
echo '</div>';
|
1229 |
// headline
|
1230 |
+
echo '<div style="display:table-row">';
|
1231 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">headline</div>';
|
1232 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
|
1233 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
|
1234 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff headline="<hr style=\'margin:20px 0\'><p>' . __( 'Please share this post:', 'shariff' ) . '</p>"]</div>';
|
1235 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Adds a headline above the Shariff buttons. Basic HTML as well as style and class attributes can be used. To remove a headline set on the plugins options page use headline="".', 'shariff' ) . '</div>';
|
1236 |
echo '</div>';
|
1237 |
// twitter_via
|
1238 |
+
echo '<div style="display:table-row">';
|
1239 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">twitter_via</div>';
|
1240 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
|
1241 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
|
1242 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff twitter_via="your_twittername"]</div>';
|
1243 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Sets the Twitter via tag.', 'shariff' ) . '</div>';
|
1244 |
echo '</div>';
|
1245 |
// flattruser
|
1246 |
+
echo '<div style="display:table-row">';
|
1247 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">flattruser</div>';
|
1248 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
|
1249 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
|
1250 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff flattruser="your_username"]</div>';
|
1251 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Sets the Flattr username.', 'shariff' ) . '</div>';
|
1252 |
echo '</div>';
|
1253 |
// patreonid
|
1254 |
+
echo '<div style="display:table-row">';
|
1255 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">patreonid</div>';
|
1256 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
|
1257 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
|
1258 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff patreonid="your_username"]</div>';
|
1259 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Sets the Patreon username.', 'shariff' ) . '</div>';
|
1260 |
echo '</div>';
|
1261 |
// paypalbuttonid
|
1262 |
+
echo '<div style="display:table-row">';
|
1263 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">paypalbuttonid</div>';
|
1264 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
|
1265 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
|
1266 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff paypalbuttonid="hosted_button_id"]</div>';
|
1267 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Sets the PayPal hosted button ID.', 'shariff' ) . '</div>';
|
1268 |
echo '</div>';
|
1269 |
// paypalmeid
|
1270 |
+
echo '<div style="display:table-row">';
|
1271 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">paypalmeid</div>';
|
1272 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
|
1273 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
|
1274 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff paypalmeid="name"]</div>';
|
1275 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Sets the PayPal.Me ID. Default amount can be added with a / e.g. name/25.', 'shariff' ) . '</div>';
|
1276 |
echo '</div>';
|
1277 |
// bitcoinaddress
|
1278 |
+
echo '<div style="display:table-row">';
|
1279 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">bitcoinaddress</div>';
|
1280 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
|
1281 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
|
1282 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff bitcoinaddress="bitcoin_address"]</div>';
|
1283 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Sets the bitcoin address.', 'shariff' ) . '</div>';
|
1284 |
echo '</div>';
|
1285 |
// media
|
1286 |
+
echo '<div style="display:table-row">';
|
1287 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">media</div>';
|
1288 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
|
1289 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'The post featured image or the first image of the post.</div>', 'shariff' );
|
1290 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff media="http://www.mydomain.com/image.jpg"]</div>';
|
1291 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Determines the default image to share for Pinterest, if no other usable image is found.', 'shariff' ) . '</div>';
|
1292 |
echo '</div>';
|
1293 |
// info_url
|
1294 |
+
echo '<div style="display:table-row">';
|
1295 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">info_url</div>';
|
1296 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
|
1297 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">http://ct.de/-2467514</div>';
|
1298 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff info_url="http://www.mydomain.com/shariff-buttons"]</div>';
|
1299 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Sets a custom link for the info button.', 'shariff' ) . '</div>';
|
1300 |
echo '</div>';
|
1301 |
// url
|
1302 |
+
echo '<div style="display:table-row">';
|
1303 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">url</div>';
|
1304 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
|
1305 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'The url of the current post or page.</div>', 'shariff' );
|
1306 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff url="http://www.mydomain.com/somepost"]</div>';
|
1307 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Changes the url to share. Only for special use cases.', 'shariff' ) . '</div>';
|
1308 |
echo '</div>';
|
1309 |
// title
|
1310 |
+
echo '<div style="display:table-row">';
|
1311 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">title</div>';
|
1312 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
|
1313 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'The title of the current post or page.</div>', 'shariff' );
|
1314 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff title="' . __( 'My Post Title', 'shariff' ) . '"]</div>';
|
1315 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Changes the title to share. Only for special use cases.', 'shariff' ) . '</div>';
|
1316 |
echo '</div>';
|
1317 |
// rssfeed
|
1318 |
+
echo '<div style="display:table-row">';
|
1319 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">rssfeed</div>';
|
1320 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
|
1321 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">http://www.mydomain.com/feed/rss/</div>';
|
1322 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff rssfeed="http://www.mydomain.com/feed/rss2/"]</div>';
|
1323 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Changes the rss feed url to another feed.', 'shariff' ) . '</div>';
|
1324 |
echo '</div>';
|
1325 |
|
1326 |
echo '</div>';
|
1333 |
$shariff3UU = $GLOBALS["shariff3UU"];
|
1334 |
|
1335 |
// status table
|
1336 |
+
echo '<div style="display:table;border-spacing:10px;margin:-10px 0 0 -10px">';
|
1337 |
|
1338 |
// statistic row
|
1339 |
+
echo '<div style="display:table-row">';
|
1340 |
+
echo '<div style="display:table-cell;width:125px">' . __( 'Statistic:', 'shariff' ) . '</div>';
|
1341 |
|
1342 |
// check if statistic is enabled
|
1343 |
if ( ! isset( $shariff3UU['backend'] ) ) {
|
1344 |
// statistic disabled message
|
1345 |
+
echo '<div style="display:table">';
|
1346 |
+
echo '<div style="display:table-row"><div style="display:table-cell;font-weight:bold">' . __( 'Disabled', 'shariff' ) . '</div></div>';
|
1347 |
echo '</div>';
|
1348 |
// end statistic row, if statistic is disabled
|
1349 |
echo '</div>';
|
1374 |
}
|
1375 |
|
1376 |
// general statistic status
|
1377 |
+
echo '<div style="display:table-cell">';
|
1378 |
+
echo '<div style="display:table">';
|
1379 |
if ( empty( $service_errors ) ) {
|
1380 |
+
echo '<div style="display:table-row"><div style="display:table-cell;font-weight:bold;color:green">' . __( 'OK', 'shariff' ) . '</div></div>';
|
1381 |
+
echo '<div style="display:table-row"><div style="display:table-cell">' . __( 'No error messages.', 'shariff' ) . '</div></div>';
|
1382 |
}
|
1383 |
elseif ( array_filter( $service_errors ) ) {
|
1384 |
+
echo '<div style="display:table-row"><div style="display:table-cell;font-weight:bold;color:red">' . __( 'Error', 'shariff' ) . '</div></div>';
|
1385 |
+
echo '<div style="display:table-row"><div style="display:table-cell">' . __( 'One or more services reported an error.', 'shariff' ) . '</div></div>';
|
1386 |
}
|
1387 |
else {
|
1388 |
+
echo '<div style="display:table-row"><div style="display:table-cell;font-weight:bold;color:orange">' . __( 'Timeout', 'shariff' ) . '</div></div>';
|
1389 |
+
echo '<div style="display:table-row"><div style="display:table-cell">' . __( 'One or more services didn\'t respond in less than five seconds.', 'shariff' ) . '</div></div>';
|
1390 |
}
|
1391 |
+
echo '<div style="display:table-row"><div style="display:table-cell"></div></div>';
|
1392 |
echo '</div>';
|
1393 |
echo '</div>';
|
1394 |
|
1398 |
// output all services
|
1399 |
foreach( $services as $service ) {
|
1400 |
// service row
|
1401 |
+
echo '<div style="display:table-row">';
|
1402 |
echo '<div class="shariff_status-first-cell">' . ucfirst( $service ) . ':</div>';
|
1403 |
+
echo '<div style="display:table-cell">';
|
1404 |
echo '<div class="shariff_status-table">';
|
1405 |
if ( isset ( $shariff3UU["disable"][$service] ) && $shariff3UU["disable"][$service] == '1' ) {
|
1406 |
+
echo '<div style="display:table-row"><div style="display:table-cell;font-weight:bold">' . __( 'Disabled', 'shariff' ) . '</div></div>';
|
1407 |
}
|
1408 |
elseif ( ! array_key_exists( $service, $service_errors ) ) {
|
1409 |
+
echo '<div style="display:table-row"><div style="display:table-cell;font-weight:bold;color:green">' . __( 'OK', 'shariff' ) . '</div></div>';
|
1410 |
+
echo '<div style="display:table-row"><div style="display:table-cell">' . __( 'Share Count:', 'shariff' ) . ' ' . $share_counts[$service] . '</div></div>';
|
1411 |
}
|
1412 |
elseif ( empty( $service_errors[$service] ) ) {
|
1413 |
+
echo '<div style="display:table-row"><div style="display:table-cell;font-weight:bold;color:orange">' . __( 'Timeout', 'shariff' ) . '</div></div>';
|
1414 |
+
echo '<div style="display:table-row"><div style="display:table-cell">';
|
1415 |
echo __( 'Service didn\'t respond in less than five seconds.', 'shariff' );
|
1416 |
echo '</div></div>';
|
1417 |
}
|
1418 |
else {
|
1419 |
+
echo '<div style="display:table-row"><div style="display:table-cell;font-weight:bold;color:red">' . __( 'Error', 'shariff' ) . '</span></div></div>';
|
1420 |
+
echo '<div style="display:table-row"><div style="display:table-cell">';
|
1421 |
echo $service_errors[$service];
|
1422 |
echo '</div></div>';
|
1423 |
}
|
1424 |
+
echo '<div style="display:table-row"><div style="display:table-cell"></div></div>';
|
1425 |
echo '</div>';
|
1426 |
echo '</div>';
|
1427 |
echo '</div>';
|
1429 |
}
|
1430 |
|
1431 |
// GD needed for QR codes of the Bitcoin links
|
1432 |
+
echo '<div style="display:table-row">';
|
1433 |
+
echo '<div style="display:table-cell">' . __( 'GD Library:', 'shariff' ) . '</div>';
|
1434 |
// working message
|
1435 |
if ( function_exists( 'gd_info' ) ) {
|
1436 |
$tmpGDinfo = gd_info();
|
1437 |
+
echo '<div style="display:table-cell">';
|
1438 |
echo '<div style="display: table">';
|
1439 |
+
echo '<div style="display:table-row"><div style="display:table-cell;font-weight:bold;color:green">' . __( 'OK', 'shariff' ) . '</div></div>';
|
1440 |
+
echo '<div style="display:table-row"><div style="display:table-cell">Version: ' . $tmpGDinfo["GD Version"] . '</div></div>';
|
1441 |
echo '</div>';
|
1442 |
echo '</div>';
|
1443 |
}
|
1444 |
else {
|
1445 |
+
echo '<div style="display:table-cell">';
|
1446 |
echo '<div style="display: table">';
|
1447 |
+
echo '<div style="display:table-row"><div style="display:table-cell;font-weight:bold;color:red">' . __( 'Error', 'shariff' ) . '</div></div>';
|
1448 |
+
echo '<div style="display:table-row"><div style="display:table-cell">' . __( 'The GD Library is not installed on this server. This is only needed for the QR codes, if your are using the bitcoin button.', 'shariff' ) . '</div></div>';
|
1449 |
echo '</div>';
|
1450 |
echo '</div>';
|
1451 |
}
|
1527 |
}
|
1528 |
|
1529 |
// ranking table
|
1530 |
+
echo '<div style="display:table;background-color:#fff">';
|
1531 |
// head
|
1532 |
+
echo '<div style="display:table-row">';
|
1533 |
+
echo '<div style="display:table-cell;font-weight:bold;border:1px solid;padding:10px">' . __( 'Rank', 'shariff' ) . '</div>';
|
1534 |
+
echo '<div style="display:table-cell;font-weight:bold;border:1px solid;padding:10px">' . __( 'Post', 'shariff' ) . '</div>';
|
1535 |
+
echo '<div style="display:table-cell;font-weight:bold;border:1px solid;padding:10px;text-align:center">' . __( 'Date', 'shariff' ) . '</div>';
|
1536 |
+
echo '<div style="display:table-cell;font-weight:bold;border:1px solid;padding:10px;text-align:center">' . __( 'Time', 'shariff' ) . '</div>';
|
1537 |
+
foreach( $services as $service => $nothing ) echo '<div style="display:table-cell;font-weight:bold;border:1px solid;padding:10px;text-align:center;">' . ucfirst( $service ) . '</div>';
|
1538 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px;font-weight:bold">' . __( 'Total', 'shariff' ) . '</div>';
|
1539 |
echo '</div>';
|
1540 |
// posts
|
1541 |
$rank = '0';
|
1542 |
foreach( $posts as $post => $value ) {
|
1543 |
$rank++;
|
1544 |
+
echo '<div style="display:table-row">';
|
1545 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px;text-align:center">' . $rank . '</div>';
|
1546 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px"><a href="' . $value['url'] . '" target="_blank">' . $value['title'] . '</a></div>';
|
1547 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">' . mysql2date( 'd.m.Y', $value['post_date'] ) . '</div>';
|
1548 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px">' . mysql2date( 'H:i', $value['post_date'] ) . '</div>';
|
1549 |
// share counts
|
1550 |
foreach( $services as $service => $nothing ) {
|
1551 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px;text-align:center">';
|
1552 |
if( isset( $value['share_counts'][$service] ) ) echo $value['share_counts'][$service];
|
1553 |
echo '</div>';
|
1554 |
}
|
1555 |
+
echo '<div style="display:table-cell;border:1px solid;padding:10px;text-align:center">';
|
1556 |
if ( isset( $value['share_counts']['total'] ) ) echo $value['share_counts']['total'];
|
1557 |
echo '</div>';
|
1558 |
echo '</div>';
|
admin/admin_notices.php
CHANGED
@@ -1,80 +1,73 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
* will be included in the shariff.php
|
4 |
-
* update info currently active for release 4.0 to direct people to the support forum
|
5 |
-
*/
|
6 |
|
7 |
// prevent direct calls to admin_notices.php
|
8 |
if ( ! class_exists('WP') ) { die(); }
|
9 |
|
10 |
-
// display an update notice
|
11 |
-
function
|
12 |
global $current_user;
|
13 |
$user_id = $current_user->ID;
|
14 |
// check that the user hasn't already clicked to ignore the message and can access options
|
15 |
-
if (
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
add_action( 'admin_notices', 'shariff3UU_admin_notice' );
|
22 |
-
|
23 |
-
// helper function for shariff3UU_admin_notice()
|
24 |
-
function shariff3UU_nag_ignore() {
|
25 |
-
global $current_user;
|
26 |
-
$user_id = $current_user->ID;
|
27 |
-
// If user clicks to ignore the notice, add that to their user meta
|
28 |
-
if ( isset( $_GET['shariff3UU_nag_ignore'] ) && sanitize_text_field($_GET['shariff3UU_nag_ignore'] ) == '0' ) {
|
29 |
-
add_user_meta( $user_id, 'shariff3UU_ignore_notice', 'true', true );
|
30 |
-
}
|
31 |
-
}
|
32 |
-
add_action('admin_init', 'shariff3UU_nag_ignore');
|
33 |
-
|
34 |
-
// display an info notice if flattr is set as a service, but no username is entered
|
35 |
-
function shariff3UU_flattr_notice() {
|
36 |
-
if ( isset( $GLOBALS["shariff3UU"]["services"] ) && ( strpos( $GLOBALS["shariff3UU"]["services"], 'flattr' ) !== false ) && empty( $GLOBALS["shariff3UU"]["flattruser"] ) && current_user_can( 'manage_options' ) ) {
|
37 |
-
echo "<div class='error'><p>" . __('Please check your ', 'shariff') . "<a href='" . get_bloginfo('wpurl') . "/wp-admin/options-general.php?page=shariff3uu&tab=advanced'>" . __('Shariff-Settings</a> - Flattr was selected, but no username was provided! Please enter your <strong>Flattr username</strong> in the shariff options!', 'shariff') . "</span></p></div>";
|
38 |
-
}
|
39 |
-
}
|
40 |
-
add_action( 'admin_notices', 'shariff3UU_flattr_notice' );
|
41 |
-
|
42 |
-
// display an info notice if patreon is set as a service, but no username is entered
|
43 |
-
function shariff3UU_patreon_notice() {
|
44 |
-
if ( isset( $GLOBALS["shariff3UU"]["services"] ) && ( strpos( $GLOBALS["shariff3UU"]["services"], 'patreon' ) !== false ) && empty( $GLOBALS["shariff3UU"]["patreonid"] ) && current_user_can( 'manage_options' ) ) {
|
45 |
-
echo "<div class='error'><p>" . __('Please check your ', 'shariff') . "<a href='" . get_bloginfo('wpurl') . "/wp-admin/options-general.php?page=shariff3uu&tab=advanced'>" . __('Shariff-Settings</a> - Patreon was selected, but no username was provided! Please enter your <strong>Patreon username</strong> in the shariff options!', 'shariff') . "</span></p></div>";
|
46 |
-
}
|
47 |
-
}
|
48 |
-
add_action( 'admin_notices', 'shariff3UU_patreon_notice' );
|
49 |
-
|
50 |
-
// display an info notice if paypal is set as a service, but no button id is entered
|
51 |
-
function shariff3UU_paypal_notice() {
|
52 |
-
if ( isset( $GLOBALS["shariff3UU"]["services"] ) && ( strpos( $GLOBALS["shariff3UU"]["services"], 'paypal' ) !== false ) && ( strpos( $GLOBALS["shariff3UU"]["services"], 'paypalme' ) === false ) && empty( $GLOBALS["shariff3UU"]["paypalbuttonid"] ) && current_user_can( 'manage_options' ) ) {
|
53 |
-
echo "<div class='error'><p>" . __('Please check your ', 'shariff') . "<a href='" . get_bloginfo('wpurl') . "/wp-admin/options-general.php?page=shariff3uu&tab=advanced'>" . __('Shariff-Settings</a> - PayPal was selected, but no button ID was provided! Please enter your <strong>Hosted Button ID</strong> in the shariff options!', 'shariff') . "</span></p></div>";
|
54 |
-
}
|
55 |
-
}
|
56 |
-
add_action( 'admin_notices', 'shariff3UU_paypal_notice' );
|
57 |
-
|
58 |
-
// display an info notice if paypalme is set as a service, but no paypal.me id is entered
|
59 |
-
function shariff3UU_paypalme_notice() {
|
60 |
-
if ( isset( $GLOBALS["shariff3UU"]["services"] ) && ( strpos( $GLOBALS["shariff3UU"]["services"], 'paypalme' ) !== false ) && empty( $GLOBALS["shariff3UU"]["paypalmeid"] ) && current_user_can( 'manage_options' ) ) {
|
61 |
-
echo "<div class='error'><p>" . __('Please check your ', 'shariff') . "<a href='" . get_bloginfo('wpurl') . "/wp-admin/options-general.php?page=shariff3uu&tab=advanced'>" . __('Shariff-Settings</a> - PayPal.Me was selected, but no ID was provided! Please enter your <strong>PayPal.Me ID</strong> in the shariff options!', 'shariff') . "</span></p></div>";
|
62 |
-
}
|
63 |
-
}
|
64 |
-
add_action( 'admin_notices', 'shariff3UU_paypalme_notice' );
|
65 |
-
|
66 |
-
// display an info notice if bitcoin is set as a service, but no address is entered
|
67 |
-
function shariff3UU_bitcoin_notice() {
|
68 |
-
if ( isset( $GLOBALS["shariff3UU"]["services"] ) && ( strpos( $GLOBALS["shariff3UU"]["services"], 'bitcoin' ) !== false ) && empty( $GLOBALS["shariff3UU"]["bitcoinaddress"] ) && current_user_can( 'manage_options' ) ) {
|
69 |
-
echo "<div class='error'><p>" . __('Please check your ', 'shariff') . "<a href='" . get_bloginfo('wpurl') . "/wp-admin/options-general.php?page=shariff3uu&tab=advanced'>" . __('Shariff-Settings</a> - Bitcoin was selected, but no address was provided! Please enter your <strong>Bitcoin Address</strong> in the shariff options!', 'shariff') . "</span></p></div>";
|
70 |
}
|
71 |
}
|
72 |
-
add_action( 'admin_notices', '
|
73 |
|
74 |
-
// display an info notice if
|
75 |
-
function
|
76 |
-
|
77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
}
|
79 |
}
|
80 |
-
add_action( 'admin_notices', '
|
1 |
<?php
|
2 |
+
// will be included in the shariff.php to display admin notices about updates and missing settings
|
|
|
|
|
|
|
3 |
|
4 |
// prevent direct calls to admin_notices.php
|
5 |
if ( ! class_exists('WP') ) { die(); }
|
6 |
|
7 |
+
// display an dismissible update notice
|
8 |
+
function shariff3UU_update_notice() {
|
9 |
global $current_user;
|
10 |
$user_id = $current_user->ID;
|
11 |
// check that the user hasn't already clicked to ignore the message and can access options
|
12 |
+
if ( current_user_can( 'manage_options' ) && ! get_option( 'shariff3UU_hide_update_notice' ) ) {
|
13 |
+
echo "<div class='notice notice-success is-dismissible shariff-update-notice'><p>";
|
14 |
+
$updatetext = __( 'Shariff Wrapper has been successfully updated to version %version. If you encounter any problems, please report them to the <a href="https://wordpress.org/support/plugin/shariff" target="_blank"><strong>Support Forum</strong></a>, so we can fix them!', 'shariff' );
|
15 |
+
$updatetext = str_replace( '%version', $GLOBALS["shariff3UU"]["version"], $updatetext );
|
16 |
+
echo $updatetext;
|
17 |
+
echo "</p></div>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
}
|
19 |
}
|
20 |
+
add_action( 'admin_notices', 'shariff3UU_update_notice' );
|
21 |
|
22 |
+
// display an info notice, if a service has been selected that requires a username, id, etc. and none has been provided
|
23 |
+
function shariff3UU_service_notice() {
|
24 |
+
// prevent php info notices
|
25 |
+
$services = array();
|
26 |
+
// check if any services are set and if user can manage options
|
27 |
+
if ( isset( $GLOBALS["shariff3UU"]["services"] ) && current_user_can( 'manage_options' ) ) {
|
28 |
+
// Flattr
|
29 |
+
if ( strpos( $GLOBALS["shariff3UU"]["services"], 'flattr' ) !== false && empty( $GLOBALS["shariff3UU"]["flattruser"] ) ) {
|
30 |
+
$services[] = "Flattr";
|
31 |
+
}
|
32 |
+
// Patreon
|
33 |
+
if ( strpos( $GLOBALS["shariff3UU"]["services"], 'patreon' ) !== false && empty( $GLOBALS["shariff3UU"]["patreonid"] ) ) {
|
34 |
+
$services[] = "Patreon";
|
35 |
+
}
|
36 |
+
// PayPal
|
37 |
+
if ( strpos( $GLOBALS["shariff3UU"]["services"], 'paypal' ) !== false && strpos( $GLOBALS["shariff3UU"]["services"], 'paypalme' ) === false && empty( $GLOBALS["shariff3UU"]["paypalbuttonid"] ) ) {
|
38 |
+
$services[] = "PayPal";
|
39 |
+
}
|
40 |
+
// PayPal.me
|
41 |
+
if ( strpos( $GLOBALS["shariff3UU"]["services"], 'paypalme' ) !== false && empty( $GLOBALS["shariff3UU"]["paypalmeid"] ) ) {
|
42 |
+
$services[] = "PayPal.Me";
|
43 |
+
}
|
44 |
+
// Bitcoin
|
45 |
+
if ( strpos( $GLOBALS["shariff3UU"]["services"], 'bitcoin' ) !== false && empty( $GLOBALS["shariff3UU"]["bitcoinaddress"] ) ) {
|
46 |
+
$services[] = "Bitcoin";
|
47 |
+
}
|
48 |
+
// Mailform
|
49 |
+
if ( strpos( $GLOBALS["shariff3UU"]["services"], 'mailform' ) !== false && isset( $GLOBALS["shariff3UU"]["disable_mailform"] ) ) {
|
50 |
+
$services[] = "Mailform";
|
51 |
+
}
|
52 |
+
// loop through services and display an info notice
|
53 |
+
foreach ( $services as $service ) {
|
54 |
+
echo "<div class='notice notice-error'><p>";
|
55 |
+
// mail form error
|
56 |
+
if ( $service === "Mailform" ) {
|
57 |
+
echo __('Please check your', 'shariff');
|
58 |
+
echo " <a href='" . get_bloginfo('wpurl') . "/wp-admin/options-general.php?page=shariff3uu&tab=mailform'>" . __('Shariff Settings', 'shariff') . "</a> - ";
|
59 |
+
echo __('Mailform has been selected as a service, but mail form functionality has been disabled on the mail form tab!', 'shariff');
|
60 |
+
}
|
61 |
+
// other service settings errors
|
62 |
+
else {
|
63 |
+
echo __('Please check your', 'shariff');
|
64 |
+
echo " <a href='" . get_bloginfo('wpurl') . "/wp-admin/options-general.php?page=shariff3uu&tab=advanced'>" . __('Shariff Settings', 'shariff') . "</a> - ";
|
65 |
+
$infotext = __('%service has been selected as a service, but no username, ID or address has been provided! Please enter the required information on the advanced tab!', 'shariff');
|
66 |
+
$infotext = str_replace( '%service', $service, $infotext );
|
67 |
+
echo $infotext;
|
68 |
+
}
|
69 |
+
echo "</p></div>";
|
70 |
+
}
|
71 |
}
|
72 |
}
|
73 |
+
add_action( 'admin_notices', 'shariff3UU_service_notice' );
|
css/shariff.css
CHANGED
@@ -262,6 +262,7 @@
|
|
262 |
.shariff_closeX svg:hover {
|
263 |
fill: #c00;
|
264 |
}
|
|
|
265 |
/* missing usernames warning */
|
266 |
.shariff-warning {
|
267 |
background-color: red;
|
262 |
.shariff_closeX svg:hover {
|
263 |
fill: #c00;
|
264 |
}
|
265 |
+
#shariff_mailform_url { display: none !important; }
|
266 |
/* missing usernames warning */
|
267 |
.shariff-warning {
|
268 |
background-color: red;
|
css/shariff.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.shariff-main{display:block!important}.shariff ul{display:flex;flex-direction:row;flex-flow:row wrap;padding:0!important;margin:0!important}.shariff li{height:35px;box-sizing:border-box;list-style-type:none!important;list-style-image:none!important;overflow:hidden!important;margin:5px!important;padding:0!important;text-indent:0!important;border-left:0 none!important}.shariff a{position:relative;display:block!important;height:35px;padding:0;box-sizing:border-box;border:0;color:#fff;text-decoration:none;background-image:none!important}.shariff a:hover{color:#fff;background-color:inherit!important;text-decoration:none!important}.shariff span{color:inherit}.shariff .shariff-count{position:absolute;height:33px;top:0;right:0;margin:1px;padding:0 8px;background-color:rgba(255,255,255,0.5)}.shariff .shariff-count,.shariff .shariff-text{font-family:Arial,Helvetica,sans-serif;font-size:12px;line-height:36px;vertical-align:top}.shariff .shariff-text{padding-left:3px}.shariff .shariff-icon svg{width:32px;height:20px;padding:7px 1px;box-sizing:content-box;fill:#fff}.shariff-button::before{content:none!important}.shariff .theme-color .shariff-count{background-color:transparent!important;color:#fff!important}.shariff .theme-grey a{background-color:#b0b0b0!important}.shariff .theme-grey a:hover{background-color:inherit!important}.shariff .theme-grey .shariff-count{background-color:transparent;color:#fff!important}.shariff .theme-white a{background-color:#fff!important;border:1px solid #ddd}.shariff .theme-white a:hover{background-color:#eee!important}.shariff .theme-white svg{fill:inherit}.shariff .theme-white .shariff-count{background-color:transparent;margin:0}.shariff .theme-round li{background:none;width:35px!important;height:35px;border-radius:50%;margin:5px}.shariff .theme-round a{position:relative;height:35px;border-radius:50%}.shariff .theme-round .shariff-icon svg{display:block;margin:auto;padding:8px 1px}.shariff .theme-round .shariff-text{display:block}.shariff .theme-round .shariff-count{display:inline;padding:0;right:0;left:0;top:0;background-color:transparent;color:transparent!important;text-align:center}.shariff .theme-round .shariff-count:hover{background-color:inherit!important;color:#fff!important}.shariff .buttonsize-small li{height:25px!important}.shariff .buttonsize-small a{height:25px!important}.shariff .buttonsize-small.orientation-vertical li{width:115px}.shariff .buttonsize-small .shariff-icon svg{width:22px;height:15px;padding:5px 1px}.shariff .buttonsize-small .shariff-text,.shariff .buttonsize-small .shariff-count{font-size:11px;line-height:25px;padding:0 5px;height:23px}.shariff .buttonsize-small .shariff-text{padding-left:1px!important}.shariff .buttonsize-small.theme-round li{width:25px!important}.shariff .buttonsize-small.theme-round a{width:25px!important}.shariff .buttonsize-small.theme-round .shariff-count{padding:0!important;height:25px!important}.shariff .orientation-vertical{flex-direction:column}.shariff .orientation-vertical li{width:135px}.shariff.shariff-align-flex-start ul{justify-content:flex-start;align-items:flex-start}.shariff.shariff-align-center ul{justify-content:center;align-items:center}.shariff.shariff-align-flex-end ul{justify-content:flex-end;align-items:flex-end}.widget .shariff.shariff-widget-align-flex-start ul{justify-content:flex-start;align-items:flex-start}.widget .shariff.shariff-widget-align-center ul{justify-content:center;align-items:center}.widget .shariff.shariff-widget-align-flex-end ul{justify-content:flex-end;align-items:flex-end}.shariff.shariff-buttonstretch li{flex:1 0 auto!important}.shariff.shariff-buttonstretch .orientation-vertical li{width:100%!important}.widget .shariff .theme-default li,.widget .shariff .theme-color li,.widget .shariff .theme-grey li,.widget .shariff .theme-round li{border:medium none;font-weight:400}.widget .shariff .theme-default a,.widget .shariff .theme-color a,.widget .shariff .theme-grey a,.widget .shariff .theme-round a{color:#fff;display:block;font-weight:400}.widget .shariff .theme-default a:hover,.widget .shariff .theme-color a:hover,.widget .shariff .theme-grey a:hover,.widget .shariff .theme-round a:hover{color:#fff;font-weight:400}.shariff_mailform{background:#eee none repeat scroll 0 0;border:1px solid;margin:10px;max-width:750px;padding:10px 15px}.shariff_mailform form{margin:0!important}.shariff_mailform fieldset{border:none;margin:0!important;padding:0}.shariff_mailform label{margin-left:3px;display:inline-block}.shariff_mailform p{margin:10px 0!important}.shariff_mailform textarea{height:auto!important;margin:0!important;padding:0;width:100%}.shariff_mailform input,.shariff_mailform select{vertical-align:baseline;height:2.2rem;padding:0 10px;width:100%;margin:0!important}.shariff_mailform_error{color:red;font-weight:700;padding:0 0 5px}.shariff_mailform_disabled{color:red;font-weight:700;padding:2px 0 0}.shariff_mailform_headline{position:relative;padding:0}.shariff_mailform_headline legend{font-weight:700!important}.shariff_mailform_submit{cursor:pointer}.shariff_closeX{position:absolute;right:0;top:0;padding:2px;text-decoration:none;box-shadow:none!important;border:none!important;cursor:pointer}.shariff_closeX svg:hover{fill:#c00}.shariff-warning{background-color:red;color:#fff;font-size:20px;font-weight:700;padding:10px;text-align:center;margin:0 auto;line-height:1.5}.shariff .info a{border:1px solid #ddd;width:35px}.shariff .shariff-button.info{width:35px;flex:0 0 auto!important}.shariff .buttonsize-small .shariff-button.info{width:25px}.shariff .buttonsize-small .info a{width:25px}.shariff .info .shariff-icon svg{display:block;margin:auto}@media only screen and (max-width: 360px){.shariff .orientation-horizontal li{width:35px}.shariff .orientation-horizontal.buttonsize-small li{width:25px}.shariff .orientation-horizontal .shariff-icon svg{display:block;margin:auto}.shariff .orientation-horizontal .shariff-count{display:none}}@media only screen and (min-width: 361px){.shariff .orientation-horizontal li{width:80px}.shariff .orientation-horizontal li .shariff-text{display:block}.shariff .orientation-horizontal li .shariff-count{display:block}}@media only screen and (min-width: 768px){.shariff .orientation-horizontal li{width:130px}.shariff .orientation-horizontal.buttonsize-small li{width:105px}.shariff .orientation-horizontal li .shariff-text{display:inline}}@media only screen and (min-device-width: 1025px){.shariff .shariff-mobile{display:none!important}}
|
1 |
+
.shariff-main{display:block!important}.shariff ul{display:flex;flex-direction:row;flex-flow:row wrap;padding:0!important;margin:0!important}.shariff li{height:35px;box-sizing:border-box;list-style-type:none!important;list-style-image:none!important;overflow:hidden!important;margin:5px!important;padding:0!important;text-indent:0!important;border-left:0 none!important}.shariff a{position:relative;display:block!important;height:35px;padding:0;box-sizing:border-box;border:0;color:#fff;text-decoration:none;background-image:none!important}.shariff a:hover{color:#fff;background-color:inherit!important;text-decoration:none!important}.shariff span{color:inherit}.shariff .shariff-count{position:absolute;height:33px;top:0;right:0;margin:1px;padding:0 8px;background-color:rgba(255,255,255,0.5)}.shariff .shariff-count,.shariff .shariff-text{font-family:Arial,Helvetica,sans-serif;font-size:12px;line-height:36px;vertical-align:top}.shariff .shariff-text{padding-left:3px}.shariff .shariff-icon svg{width:32px;height:20px;padding:7px 1px;box-sizing:content-box;fill:#fff}.shariff-button::before{content:none!important}.shariff .theme-color .shariff-count{background-color:transparent!important;color:#fff!important}.shariff .theme-grey a{background-color:#b0b0b0!important}.shariff .theme-grey a:hover{background-color:inherit!important}.shariff .theme-grey .shariff-count{background-color:transparent;color:#fff!important}.shariff .theme-white a{background-color:#fff!important;border:1px solid #ddd}.shariff .theme-white a:hover{background-color:#eee!important}.shariff .theme-white svg{fill:inherit}.shariff .theme-white .shariff-count{background-color:transparent;margin:0}.shariff .theme-round li{background:none;width:35px!important;height:35px;border-radius:50%;margin:5px}.shariff .theme-round a{position:relative;height:35px;border-radius:50%}.shariff .theme-round .shariff-icon svg{display:block;margin:auto;padding:8px 1px}.shariff .theme-round .shariff-text{display:block}.shariff .theme-round .shariff-count{display:inline;padding:0;right:0;left:0;top:0;background-color:transparent;color:transparent!important;text-align:center}.shariff .theme-round .shariff-count:hover{background-color:inherit!important;color:#fff!important}.shariff .buttonsize-small li{height:25px!important}.shariff .buttonsize-small a{height:25px!important}.shariff .buttonsize-small.orientation-vertical li{width:115px}.shariff .buttonsize-small .shariff-icon svg{width:22px;height:15px;padding:5px 1px}.shariff .buttonsize-small .shariff-text,.shariff .buttonsize-small .shariff-count{font-size:11px;line-height:25px;padding:0 5px;height:23px}.shariff .buttonsize-small .shariff-text{padding-left:1px!important}.shariff .buttonsize-small.theme-round li{width:25px!important}.shariff .buttonsize-small.theme-round a{width:25px!important}.shariff .buttonsize-small.theme-round .shariff-count{padding:0!important;height:25px!important}.shariff .orientation-vertical{flex-direction:column}.shariff .orientation-vertical li{width:135px}.shariff.shariff-align-flex-start ul{justify-content:flex-start;align-items:flex-start}.shariff.shariff-align-center ul{justify-content:center;align-items:center}.shariff.shariff-align-flex-end ul{justify-content:flex-end;align-items:flex-end}.widget .shariff.shariff-widget-align-flex-start ul{justify-content:flex-start;align-items:flex-start}.widget .shariff.shariff-widget-align-center ul{justify-content:center;align-items:center}.widget .shariff.shariff-widget-align-flex-end ul{justify-content:flex-end;align-items:flex-end}.shariff.shariff-buttonstretch li{flex:1 0 auto!important}.shariff.shariff-buttonstretch .orientation-vertical li{width:100%!important}.widget .shariff .theme-default li,.widget .shariff .theme-color li,.widget .shariff .theme-grey li,.widget .shariff .theme-round li{border:medium none;font-weight:400}.widget .shariff .theme-default a,.widget .shariff .theme-color a,.widget .shariff .theme-grey a,.widget .shariff .theme-round a{color:#fff;display:block;font-weight:400}.widget .shariff .theme-default a:hover,.widget .shariff .theme-color a:hover,.widget .shariff .theme-grey a:hover,.widget .shariff .theme-round a:hover{color:#fff;font-weight:400}.shariff_mailform{background:#eee none repeat scroll 0 0;border:1px solid;margin:10px;max-width:750px;padding:10px 15px}.shariff_mailform form{margin:0!important}.shariff_mailform fieldset{border:none;margin:0!important;padding:0}.shariff_mailform label{margin-left:3px;display:inline-block}.shariff_mailform p{margin:10px 0!important}.shariff_mailform textarea{height:auto!important;margin:0!important;padding:0;width:100%}.shariff_mailform input,.shariff_mailform select{vertical-align:baseline;height:2.2rem;padding:0 10px;width:100%;margin:0!important}.shariff_mailform_error{color:red;font-weight:700;padding:0 0 5px}.shariff_mailform_disabled{color:red;font-weight:700;padding:2px 0 0}.shariff_mailform_headline{position:relative;padding:0}.shariff_mailform_headline legend{font-weight:700!important}.shariff_mailform_submit{cursor:pointer}.shariff_closeX{position:absolute;right:0;top:0;padding:2px;text-decoration:none;box-shadow:none!important;border:none!important;cursor:pointer}.shariff_closeX svg:hover{fill:#c00}#shariff_mailform_url{display:none!important}.shariff-warning{background-color:red;color:#fff;font-size:20px;font-weight:700;padding:10px;text-align:center;margin:0 auto;line-height:1.5}.shariff .info a{border:1px solid #ddd;width:35px}.shariff .shariff-button.info{width:35px;flex:0 0 auto!important}.shariff .buttonsize-small .shariff-button.info{width:25px}.shariff .buttonsize-small .info a{width:25px}.shariff .info .shariff-icon svg{display:block;margin:auto}@media only screen and (max-width: 360px){.shariff .orientation-horizontal li{width:35px}.shariff .orientation-horizontal.buttonsize-small li{width:25px}.shariff .orientation-horizontal .shariff-icon svg{display:block;margin:auto}.shariff .orientation-horizontal .shariff-count{display:none}}@media only screen and (min-width: 361px){.shariff .orientation-horizontal li{width:80px}.shariff .orientation-horizontal li .shariff-text{display:block}.shariff .orientation-horizontal li .shariff-count{display:block}}@media only screen and (min-width: 768px){.shariff .orientation-horizontal li{width:130px}.shariff .orientation-horizontal.buttonsize-small li{width:105px}.shariff .orientation-horizontal li .shariff-text{display:inline}}@media only screen and (min-device-width: 1025px){.shariff .shariff-mobile{display:none!important}}
|
css/shariff_admin-notice.css
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
.shariff_admininfo_cross { float:right; margin-top:6px }
|
2 |
-
.shariff_cross_icon { line-height:1; text-align:center; width:20px; text-decoration:none }
|
3 |
-
.shariff_cross_icon::before { content:"\00D7"; font-weight:bold; font-size:2em }
|
|
|
|
|
|
css/shariff_options.css
DELETED
@@ -1,86 +0,0 @@
|
|
1 |
-
/* Shariff Wrapper options page */
|
2 |
-
.shariff code { font-size: 12px !important; }
|
3 |
-
.shariff_options-table {
|
4 |
-
display: table;
|
5 |
-
border-spacing: 10px;
|
6 |
-
margin: -15px 0 -5px -5px;
|
7 |
-
border-collapse: separate;
|
8 |
-
}
|
9 |
-
.shariff_options-row { display: table-row; }
|
10 |
-
.shariff_options-cell {
|
11 |
-
display: table-cell;
|
12 |
-
vertical-align: middle;
|
13 |
-
min-width: 75px;
|
14 |
-
}
|
15 |
-
.shariff_status-table { display: table; }
|
16 |
-
.shariff_status-col { width: 400px; }
|
17 |
-
.shariff_status-col2 { word-wrap: break-word; }
|
18 |
-
.shariff_status-row { display: table-row; }
|
19 |
-
.shariff_status-main-table {
|
20 |
-
display: table;
|
21 |
-
border-spacing: 10px;
|
22 |
-
margin: -10px 0 0 -10px;
|
23 |
-
}
|
24 |
-
.shariff_status-first-cell {
|
25 |
-
display: table-cell;
|
26 |
-
width: 125px;
|
27 |
-
}
|
28 |
-
.shariff_status-cell { display: table-cell; }
|
29 |
-
.shariff_status-disabled { font-weight: bold; }
|
30 |
-
.shariff_status-ok {
|
31 |
-
font-weight: bold;
|
32 |
-
color: green;
|
33 |
-
}
|
34 |
-
.shariff_status-error {
|
35 |
-
font-weight: bold;
|
36 |
-
color: red;
|
37 |
-
}
|
38 |
-
.shariff_status-timeout {
|
39 |
-
font-weight: bold;
|
40 |
-
color: orange;
|
41 |
-
}
|
42 |
-
.shariff_shortcode_row_head { display: table-row; }
|
43 |
-
.shariff_shortcode_cell_head {
|
44 |
-
display: table-cell;
|
45 |
-
border: 1px solid;
|
46 |
-
padding: 10px;
|
47 |
-
}
|
48 |
-
.shariff_shortcode_cell_name-option {
|
49 |
-
display: table-cell;
|
50 |
-
border: 1px solid;
|
51 |
-
padding: 10px;
|
52 |
-
width: 100px;
|
53 |
-
font-weight: bold;
|
54 |
-
}
|
55 |
-
.shariff_shortcode_cell_default {
|
56 |
-
display: table-cell;
|
57 |
-
border: 1px solid;
|
58 |
-
padding: 10px;
|
59 |
-
width: 275px;
|
60 |
-
font-weight: bold;
|
61 |
-
}
|
62 |
-
.shariff_shortcode_cell_example {
|
63 |
-
display: table-cell;
|
64 |
-
border: 1px solid;
|
65 |
-
padding: 10px;
|
66 |
-
width: 275px;
|
67 |
-
font-weight: bold;
|
68 |
-
}
|
69 |
-
.shariff_shortcode_cell_description {
|
70 |
-
display: table-cell;
|
71 |
-
border: 1px solid;
|
72 |
-
padding: 10px;
|
73 |
-
font-weight: bold;
|
74 |
-
}
|
75 |
-
.shariff_shortcode_table {
|
76 |
-
display: table;
|
77 |
-
background-color: #fff;
|
78 |
-
}
|
79 |
-
.shariff_shortcode_row {
|
80 |
-
display: table-row;
|
81 |
-
}
|
82 |
-
.shariff_shortcode_cell {
|
83 |
-
display: table-cell;
|
84 |
-
border: 1px solid;
|
85 |
-
padding: 10px;
|
86 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css/style.css
DELETED
@@ -1,293 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
Theme Name: Enfold Child
|
3 |
-
Description: A <a href='http://codex.wordpress.org/Child_Themes'>Child Theme</a> for the Enfold Wordpress Theme. If you plan to do a lot of file modifications we recommend to use this Theme instead of the original Theme. Updating wil be much easier then.
|
4 |
-
Version: 1.0
|
5 |
-
Author: Kriesi
|
6 |
-
Author URI: http://www.kriesi.at
|
7 |
-
Template: enfold
|
8 |
-
*/
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
/*Add your own styles here:*/
|
13 |
-
|
14 |
-
.avia-menu.av_menu_icon_beside {
|
15 |
-
margin-right: 20px;
|
16 |
-
}
|
17 |
-
|
18 |
-
.social_bookmarks li {
|
19 |
-
margin: 0 1px;
|
20 |
-
}
|
21 |
-
|
22 |
-
.entry-content a {
|
23 |
-
font-weight: bold;
|
24 |
-
}
|
25 |
-
|
26 |
-
#top .flex_column .template-blog .post-title {
|
27 |
-
font-size: 20px;
|
28 |
-
}
|
29 |
-
|
30 |
-
.image-overlay.overlay-type-extern .image-overlay-inside::before {
|
31 |
-
display: none;
|
32 |
-
}
|
33 |
-
|
34 |
-
.blog-tags.minor-meta {
|
35 |
-
margin-top: 10px;
|
36 |
-
}
|
37 |
-
|
38 |
-
.post-entry {
|
39 |
-
margin-bottom: 20px;
|
40 |
-
}
|
41 |
-
|
42 |
-
.author-extra-border {
|
43 |
-
display:none;
|
44 |
-
}
|
45 |
-
|
46 |
-
#top .fullsize .related_posts {
|
47 |
-
padding: 0 0 33px;
|
48 |
-
}
|
49 |
-
|
50 |
-
.post-author-format-type.blog-meta {
|
51 |
-
margin-bottom: 10px !important;
|
52 |
-
}
|
53 |
-
|
54 |
-
#shariff_mailform legend {
|
55 |
-
font-weight: bold;
|
56 |
-
}
|
57 |
-
|
58 |
-
.shariff_mailform_headline {
|
59 |
-
margin-bottom: 5px;
|
60 |
-
}
|
61 |
-
|
62 |
-
.tabcontainer.border_tabs.top_tab.tab_initial_open.tab_initial_open__1 {
|
63 |
-
margin-bottom: 0;
|
64 |
-
}
|
65 |
-
|
66 |
-
#shariff_mailform textarea {
|
67 |
-
background-color: #fff !important;
|
68 |
-
width: 100% !important;
|
69 |
-
margin: 0 !important;
|
70 |
-
}
|
71 |
-
|
72 |
-
#shariff_mailform form {
|
73 |
-
margin: 0 !important;
|
74 |
-
}
|
75 |
-
|
76 |
-
.shariff_mailform {
|
77 |
-
max-width: 1000px;
|
78 |
-
margin: 10px 0;
|
79 |
-
}
|
80 |
-
|
81 |
-
#shariff_mailform input[type="text"], input[type="email"] {
|
82 |
-
background-color: #fff !important;
|
83 |
-
width: 40% !important;
|
84 |
-
}
|
85 |
-
|
86 |
-
#shariff_mailform input {
|
87 |
-
display: inline !important;
|
88 |
-
margin-bottom: 0 !important;
|
89 |
-
}
|
90 |
-
|
91 |
-
.widget.clearfix.widget_nav_menu {
|
92 |
-
padding-bottom: 0;
|
93 |
-
}
|
94 |
-
|
95 |
-
#socket .copyright {
|
96 |
-
padding-left: 10px;
|
97 |
-
}
|
98 |
-
|
99 |
-
#socket .social_bookmarks {
|
100 |
-
padding-right: 10px;
|
101 |
-
}
|
102 |
-
|
103 |
-
#socket {
|
104 |
-
margin-bottom: -3px;
|
105 |
-
}
|
106 |
-
|
107 |
-
.content, .sidebar {
|
108 |
-
padding-bottom: 0;
|
109 |
-
}
|
110 |
-
|
111 |
-
#top.single-post .big-preview.single-big a,
|
112 |
-
#top.single-post .small-preview {
|
113 |
-
pointer-events: none;
|
114 |
-
cursor: default;
|
115 |
-
}
|
116 |
-
|
117 |
-
#jp_main_bg_header {
|
118 |
-
height: 340px;
|
119 |
-
max-height: 340px;
|
120 |
-
}
|
121 |
-
|
122 |
-
.avia_textblock a {
|
123 |
-
font-weight: bold;
|
124 |
-
}
|
125 |
-
|
126 |
-
.shariff a {
|
127 |
-
font-weight: normal !important;
|
128 |
-
}
|
129 |
-
|
130 |
-
.uebermichimg {
|
131 |
-
margin: 0 -15px 10px 20px !important;
|
132 |
-
}
|
133 |
-
|
134 |
-
.sharifflogoimg {
|
135 |
-
margin: -35px -20px 2px 20px !important;
|
136 |
-
}
|
137 |
-
|
138 |
-
.submit:hover {
|
139 |
-
color: #fff !important;
|
140 |
-
}
|
141 |
-
|
142 |
-
::selection {background: #2d5c88; color: #ffffff;}
|
143 |
-
::-moz-selection {background: #2d5c88; color: #ffffff;}
|
144 |
-
|
145 |
-
h1 {
|
146 |
-
margin-bottom: 0;
|
147 |
-
}
|
148 |
-
|
149 |
-
.widgettitle {
|
150 |
-
margin-top: 0 !important;
|
151 |
-
}
|
152 |
-
|
153 |
-
#wrap_all {
|
154 |
-
background-color: #fff !important;
|
155 |
-
}
|
156 |
-
|
157 |
-
.container_wrap {
|
158 |
-
border: none;
|
159 |
-
}
|
160 |
-
|
161 |
-
.widget {
|
162 |
-
padding: 10px 0 5px 0;
|
163 |
-
}
|
164 |
-
|
165 |
-
.post-date {
|
166 |
-
display: block;
|
167 |
-
}
|
168 |
-
|
169 |
-
.bg-logo {
|
170 |
-
color: #2d5c88 !important;
|
171 |
-
font-size: 24px;
|
172 |
-
line-height: 60px;
|
173 |
-
}
|
174 |
-
|
175 |
-
.flex_column .template-blog .post_delimiter {
|
176 |
-
margin: 0 0 20px;
|
177 |
-
padding: 0;
|
178 |
-
}
|
179 |
-
|
180 |
-
#header, #header_main {
|
181 |
-
height: 60px;
|
182 |
-
}
|
183 |
-
|
184 |
-
#advanced_menu_toggle, #advanced_menu_hide {
|
185 |
-
margin-top: -34px;
|
186 |
-
}
|
187 |
-
|
188 |
-
#mobile-advanced li {
|
189 |
-
background-color: #fff;
|
190 |
-
}
|
191 |
-
|
192 |
-
#mobile-advanced {
|
193 |
-
min-height: auto !important;
|
194 |
-
padding: 59px 0 0;
|
195 |
-
background-color: #fff;
|
196 |
-
}
|
197 |
-
|
198 |
-
#advanced_menu_hide {
|
199 |
-
right: 25px;
|
200 |
-
top: 41px;
|
201 |
-
}
|
202 |
-
|
203 |
-
#advanced_menu_toggle, #advanced_menu_hide {
|
204 |
-
line-height: 42px;
|
205 |
-
}
|
206 |
-
|
207 |
-
#top .comment-form-url input, #top .comment-form-email input, #top .comment-form-author input {
|
208 |
-
width: auto !important;
|
209 |
-
}
|
210 |
-
|
211 |
-
#commentform label {
|
212 |
-
left: 10px;
|
213 |
-
}
|
214 |
-
|
215 |
-
#top .comment-form-url input, #top .comment-form-email input, #top .comment-form-author input {
|
216 |
-
max-width: 100%;
|
217 |
-
}
|
218 |
-
|
219 |
-
#main {
|
220 |
-
background: transparent url(https://www.jplambeck.de/wp-content/uploads/2015/06/jplambeck_bg_header_m.jpg) top left no-repeat fixed !important;
|
221 |
-
background-size: 100% 431px !important;
|
222 |
-
border: none !important;
|
223 |
-
}
|
224 |
-
|
225 |
-
#header, #header_main {
|
226 |
-
padding: 0 10px;
|
227 |
-
}
|
228 |
-
|
229 |
-
@media (max-width: 360px) {
|
230 |
-
.gravatar {
|
231 |
-
visibility: hidden;
|
232 |
-
position: absolute;
|
233 |
-
}
|
234 |
-
.comment_content {
|
235 |
-
margin: 0;
|
236 |
-
}
|
237 |
-
.responsive #top #wrap_all .container {
|
238 |
-
max-width: 100%;
|
239 |
-
width: 100%;
|
240 |
-
}
|
241 |
-
}
|
242 |
-
@media (max-width: 767px) {
|
243 |
-
.flex_column.av_one_fourth.no_margin.flex_column_div.avia-builder-el-7.el_after_av_three_fourth.avia-builder-el-last {
|
244 |
-
margin-top: 0 !important;
|
245 |
-
}
|
246 |
-
#shariff_mailform input {
|
247 |
-
width: 100% !important;
|
248 |
-
}
|
249 |
-
#shariff_mailform input[type="text"], input[type="email"] {
|
250 |
-
width: 100% !important;
|
251 |
-
}
|
252 |
-
}
|
253 |
-
|
254 |
-
@media (max-width: 1024px) {
|
255 |
-
.responsive #top #wrap_all .container {
|
256 |
-
max-width: 100%;
|
257 |
-
width: 100%;
|
258 |
-
}
|
259 |
-
.container {
|
260 |
-
padding: 0;
|
261 |
-
}
|
262 |
-
.uebermichimg {
|
263 |
-
height: 50%;
|
264 |
-
width: 50%;
|
265 |
-
}
|
266 |
-
.sharifflogoimg {
|
267 |
-
height: 50%;
|
268 |
-
width: 50%;
|
269 |
-
}
|
270 |
-
}
|
271 |
-
|
272 |
-
@media (max-width: 1200px) {
|
273 |
-
#top .no_margin.av_three_fourth {
|
274 |
-
width: 70%;
|
275 |
-
}
|
276 |
-
#top .no_margin.av_one_fourth {
|
277 |
-
width: 30%;
|
278 |
-
}
|
279 |
-
}
|
280 |
-
|
281 |
-
@media (min-width: 1025px) {
|
282 |
-
#main {
|
283 |
-
background: transparent url(https://www.jplambeck.de/wp-content/uploads/2015/06/jplambeck_bg_header_l.jpg) top left no-repeat fixed !important;
|
284 |
-
background-size: 100% 431px !important;
|
285 |
-
}
|
286 |
-
}
|
287 |
-
|
288 |
-
@media (min-width: 1921px) {
|
289 |
-
#main {
|
290 |
-
background: transparent url(https://www.jplambeck.de/wp-content/uploads/2015/06/jplambeck_bg_header_xl.jpg) top left no-repeat fixed !important;
|
291 |
-
background-size: 100% 431px !important;
|
292 |
-
}
|
293 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/shariff-media.js
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// shariff media upload
|
2 |
+
jQuery(document).ready(function($){
|
3 |
+
$("#shariff-upload-btn").click(function(e) {
|
4 |
+
e.preventDefault();
|
5 |
+
var image = wp.media({
|
6 |
+
title: shariff_media.choose_image,
|
7 |
+
multiple: false
|
8 |
+
}).open()
|
9 |
+
.on("select", function(e){
|
10 |
+
// this will return the selected image from the media uploader, the result is an object
|
11 |
+
var uploaded_image = image.state().get("selection").first();
|
12 |
+
// output to the console uploaded_image
|
13 |
+
console.log(uploaded_image);
|
14 |
+
// convert uploaded_image to a JSON object to make accessing it easier
|
15 |
+
var image_url = uploaded_image.toJSON().url;
|
16 |
+
// assign the url value to the input field
|
17 |
+
$("#shariff-image-url").val(image_url);
|
18 |
+
});
|
19 |
+
});
|
20 |
+
});
|
js/shariff-notice.js
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).on( 'click', '.shariff-update-notice .notice-dismiss', function() {
|
2 |
+
jQuery.ajax({
|
3 |
+
url: ajaxurl,
|
4 |
+
data: {
|
5 |
+
action: 'shariffdismiss'
|
6 |
+
}
|
7 |
+
})
|
8 |
+
|
9 |
+
})
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
=== Shariff Wrapper ===
|
2 |
Contributors: 3UU, starguide
|
3 |
Tags: Shariff, Facebook, Twitter, VKontakte, VK, GooglePlus, WhatsApp, share buttons, sharing, privacy, social
|
4 |
Requires at least: 4.4
|
5 |
-
Tested up to: 4.
|
6 |
-
Stable tag: 4.
|
7 |
License: MIT
|
8 |
License URI: http://opensource.org/licenses/MIT
|
9 |
Donate link: http://folge.link/?bitcoin=1Ritz1iUaLaxuYcXhUCoFhkVRH6GWiMTP
|
@@ -172,6 +172,16 @@ fixed in the future - if we have time to spend or you provide us with a lot of "
|
|
172 |
|
173 |
== Changelog ==
|
174 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
= 4.1.2 =
|
176 |
- new fallback for share count requests in case pretty permalinks are disabled
|
177 |
- new filter shariff3UU_render_atts to change options on the fly (thx Ov3rfly)
|
1 |
+
=== Shariff Wrapper ===
|
2 |
Contributors: 3UU, starguide
|
3 |
Tags: Shariff, Facebook, Twitter, VKontakte, VK, GooglePlus, WhatsApp, share buttons, sharing, privacy, social
|
4 |
Requires at least: 4.4
|
5 |
+
Tested up to: 4.6
|
6 |
+
Stable tag: 4.2.0
|
7 |
License: MIT
|
8 |
License URI: http://opensource.org/licenses/MIT
|
9 |
Donate link: http://folge.link/?bitcoin=1Ritz1iUaLaxuYcXhUCoFhkVRH6GWiMTP
|
172 |
|
173 |
== Changelog ==
|
174 |
|
175 |
+
= 4.2.0 =
|
176 |
+
- new option to set the rate limit for sending mails using the mail form
|
177 |
+
- added home url as fallback for share count requests
|
178 |
+
- added further anti-spam prevention mechanics
|
179 |
+
- added noopener and noreferrer to share links
|
180 |
+
- fixed double encoding of share count request links
|
181 |
+
- updated media uploader request for translation
|
182 |
+
- updated handling of admin notices following WordPress core
|
183 |
+
- tested and optimized for WordPress 4.6
|
184 |
+
|
185 |
= 4.1.2 =
|
186 |
- new fallback for share count requests in case pretty permalinks are disabled
|
187 |
- new filter shariff3UU_render_atts to change options on the fly (thx Ov3rfly)
|
shariff.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Shariff Wrapper
|
4 |
* Plugin URI: https://de.wordpress.org/plugins/shariff/
|
5 |
* Description: The Shariff Wrapper provides share buttons that respect the privacy of your visitors and are compliant to the German data protection laws.
|
6 |
-
* Version: 4.
|
7 |
* Author: Jan-Peter Lambeck & 3UU
|
8 |
* Author URI: https://de.wordpress.org/plugins/shariff/
|
9 |
* License: MIT
|
@@ -26,7 +26,7 @@ $shariff3UU = array_merge( $shariff3UU_basic, $shariff3UU_design, $shariff3UU_ad
|
|
26 |
// update function to perform tasks _once_ after an update, based on version number to work for automatic as well as manual updates
|
27 |
function shariff3UU_update() {
|
28 |
/******************** ADJUST VERSION ********************/
|
29 |
-
$code_version = "4.
|
30 |
/******************** ADJUST VERSION ********************/
|
31 |
|
32 |
// get options
|
@@ -69,6 +69,12 @@ if ( is_admin() ) {
|
|
69 |
include( plugin_dir_path( __FILE__ ) . 'admin/admin_notices.php' );
|
70 |
}
|
71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
// add meta links on plugin page
|
73 |
function shariff3UU_meta_links( $links, $file ) {
|
74 |
$plugin = plugin_basename(__FILE__);
|
@@ -110,7 +116,7 @@ function shariff3UU_share_counts( WP_REST_Request $request ) {
|
|
110 |
$shariff3UU = $GLOBALS["shariff3UU"];
|
111 |
|
112 |
// parameters
|
113 |
-
$url = urldecode(
|
114 |
$services = $request['services'];
|
115 |
$timestamp = $request['timestamp'];
|
116 |
|
@@ -468,6 +474,16 @@ function shariff3UU_excerpt( $content ) {
|
|
468 |
}
|
469 |
add_filter( 'the_excerpt', 'shariff3UU_excerpt' );
|
470 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
471 |
// add mailform to bbpress_replies
|
472 |
function bbp_add_mailform_to_bbpress_replies() {
|
473 |
$content = '';
|
@@ -628,7 +644,7 @@ function shariff3UU_render( $atts, $content = null ) {
|
|
628 |
// add information for share count request
|
629 |
if ( array_key_exists( 'backend', $atts ) && $atts['backend'] == "on" ) {
|
630 |
// share url
|
631 |
-
$output .= ' data-url="' . esc_html(
|
632 |
// timestamp for cache
|
633 |
$output .= ' data-timestamp="' . absint( get_the_modified_date( 'U', true ) ) . '"';
|
634 |
// add external api if entered
|
@@ -643,6 +659,10 @@ function shariff3UU_render( $atts, $content = null ) {
|
|
643 |
elseif ( ! get_option('permalink_structure') ) {
|
644 |
$output .= ' data-backendurl="?rest_route=/shariff/v1/share_counts&"';
|
645 |
}
|
|
|
|
|
|
|
|
|
646 |
}
|
647 |
$output .= '>';
|
648 |
|
@@ -748,7 +768,7 @@ function shariff3UU_render( $atts, $content = null ) {
|
|
748 |
$button_text_array = '';
|
749 |
|
750 |
// build the actual button
|
751 |
-
$output .= '<a href="' . $button_url . '" title="' . $button_title . '" aria-label="' . $button_title . '" role="button" rel="nofollow" class="shariff-link" ';
|
752 |
// same window?
|
753 |
if ( ! isset( $same_window ) || isset( $same_window ) && $same_window != '1' ) $output .= 'target="_blank" ';
|
754 |
$output .= 'style="background-color:' . $main_color . $border_radius;
|
@@ -819,7 +839,7 @@ function shariff3UU_render( $atts, $content = null ) {
|
|
819 |
|
820 |
// if the service totalnumber is set, just output the total share count
|
821 |
if ( array_key_exists( '0', $service_array ) && $service_array['0'] == 'totalnumber' ) {
|
822 |
-
$output = '<span class="shariff" data-services="totalnumber" data-url="' .
|
823 |
// add external api
|
824 |
if ( isset( $shariff3UU["external_host"] ) && ! empty( $shariff3UU["external_host"] ) && isset( $shariff3UU["external_direct"] ) ) {
|
825 |
$output .= ' data-backendurl="' . $shariff3UU["external_host"] . '"';
|
@@ -851,7 +871,11 @@ function shariff3UU_viewmail( $content ) {
|
|
851 |
return $content;
|
852 |
}
|
853 |
}
|
854 |
-
|
|
|
|
|
|
|
|
|
855 |
|
856 |
// add mailform
|
857 |
function shariff3UU_addMailForm( $content, $error ) {
|
@@ -879,7 +903,6 @@ function shariff3UU_addMailForm( $content, $error ) {
|
|
879 |
// if language is set to automatic try geoip
|
880 |
// http://datenverwurstungszentrale.com/stadt-und-land-mittels-geoip-ermitteln-268.htm
|
881 |
elseif ( function_exists('geoip_country_code_by_name') ) {
|
882 |
-
# if ( WP_DEBUG == TRUE ) echo '<div>Currently using the following country code: ' . geoip_country_code_by_name( $_SERVER["REMOTE_ADDR"] ) . '</div>';
|
883 |
switch ( @geoip_country_code_by_name( $_SERVER[REMOTE_ADDR] ) ) {
|
884 |
case 'DE': $lang = 'DE';
|
885 |
break;
|
@@ -899,17 +922,6 @@ function shariff3UU_addMailForm( $content, $error ) {
|
|
899 |
$lang = http_negotiate_language( $available_lang );
|
900 |
}
|
901 |
|
902 |
-
// sonst per "WP-Plugin GeoIP Detection"
|
903 |
-
// siehe https://wordpress.org/plugins/geoip-detect/
|
904 |
-
// rtzrtz: erstmal raus, weil nicht mit WPMU https://wordpress.org/support/topic/will-this-work-with-multisite-2?replies=6
|
905 |
-
/*
|
906 |
-
elseif ( function_exists( "geoip_detect2_get_info_from_ip" ) ) {
|
907 |
-
if ( WP_DEBUG == TRUE ) echo '<br>nutze gerade geoip_detect2_get_info_from_ip<br>';
|
908 |
-
$record = geoip_detect2_get_info_from_ip( $_SERVER["REMOTE_ADDR"] );
|
909 |
-
switch( $record->country->isoCode) { case 'DE': $lang='DE'; break; case 'AT': $lang='DE'; break; case 'CH': $lang='DE'; break; default: $lang='EN'; }
|
910 |
-
}
|
911 |
-
*/
|
912 |
-
|
913 |
// include selected language
|
914 |
include( plugin_dir_path( __FILE__ ) . '/locale/mailform-' . $lang . '.php' );
|
915 |
|
@@ -967,11 +979,12 @@ function shariff3UU_addMailForm( $content, $error ) {
|
|
967 |
<p><label for="mailto">' . $mf_rcpt[$lang] . '</label><br>
|
968 |
<input type="text" name="mailto" id="mailto" value="' . $mf_content_mailto . '" size="27" placeholder="' . $mf_rcpt_ph[$lang] . '" required>' . $mf_to_error_html . '</p>
|
969 |
<p><label for="from">' . $mf_from[$lang] . $mf_optional_text . '</label><br>
|
970 |
-
<input type="email" name="from"
|
971 |
<p><label for="name">' . $mf_name[$lang] . '</label><br>
|
972 |
<input type="text" name="sender" id="sender" value="' . $mf_content_sender . '" size="27" placeholder="' . $mf_name_ph[$lang] . '"></p>
|
973 |
<p><label for="mail_comment">' . $mf_comment[$lang] . '</label><br>
|
974 |
<textarea name="mail_comment" rows="4">' . $mf_content_mail_comment . '</textarea></p>
|
|
|
975 |
</fieldset>
|
976 |
<p><input type="submit" class="shariff_mailform_submit" value="' . $mf_send[$lang] . '" /></p>
|
977 |
<p>' . $mf_info[$lang] . '</p>
|
@@ -993,190 +1006,218 @@ function shariff3UU_set_wp_mail_from( $email ) { return sanitize_text_field( $GL
|
|
993 |
function sharif3UU_procSentMail( $content ) {
|
994 |
// get options
|
995 |
$shariff3UU = $GLOBALS["shariff3UU"];
|
996 |
-
|
997 |
-
//
|
998 |
-
$
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
-
|
1003 |
-
|
1004 |
-
//
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
$
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
|
1026 |
-
if ( $
|
1027 |
-
|
1028 |
-
$
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
|
|
|
|
|
|
|
|
|
|
1034 |
}
|
1035 |
-
|
1036 |
-
|
1037 |
-
}
|
1038 |
-
elseif ( ! empty( $GLOBALS["shariff3UU_mailform"]["mail_sender_name"] ) ) {
|
1039 |
-
add_filter( 'wp_mail_from_name', 'shariff3UU_set3_wp_mail_from_name' );
|
1040 |
}
|
1041 |
-
|
1042 |
-
|
|
|
|
|
|
|
|
|
1043 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1044 |
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
|
|
1063 |
}
|
1064 |
-
}
|
1065 |
|
1066 |
-
|
1067 |
-
|
1068 |
-
|
1069 |
-
|
1070 |
-
|
1071 |
-
|
1072 |
-
|
1073 |
|
1074 |
-
|
1075 |
-
|
1076 |
|
1077 |
-
|
1078 |
-
|
1079 |
|
1080 |
-
|
1081 |
|
1082 |
-
|
1083 |
-
|
1084 |
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
1092 |
-
|
1093 |
-
|
1094 |
-
|
1095 |
-
|
1096 |
-
|
1097 |
|
1098 |
-
|
1099 |
-
|
1100 |
|
1101 |
-
|
1102 |
-
|
1103 |
-
|
1104 |
-
|
1105 |
|
1106 |
-
|
1107 |
-
|
1108 |
-
|
1109 |
-
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
|
1115 |
|
1116 |
-
|
1117 |
|
1118 |
-
|
1119 |
-
|
1120 |
|
1121 |
-
|
|
|
1122 |
|
1123 |
-
|
1124 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1125 |
|
1126 |
-
|
1127 |
-
|
1128 |
-
|
1129 |
-
|
1130 |
-
|
1131 |
-
$error['error'] = '1';
|
1132 |
-
$error['from'] = '1';
|
1133 |
}
|
1134 |
-
|
1135 |
-
|
1136 |
-
|
1137 |
-
$error['error'] = '1';
|
1138 |
-
$error['to'] = '1';
|
1139 |
}
|
1140 |
-
|
1141 |
-
|
1142 |
-
|
1143 |
-
|
1144 |
-
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
1148 |
-
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
1152 |
-
|
1153 |
-
$mailnotice .= $rcpt . '<br>';
|
1154 |
}
|
1155 |
-
$mailnotice .= '</div>';
|
1156 |
-
// add to content
|
1157 |
-
$content = $mailnotice . $content;
|
1158 |
}
|
|
|
1159 |
}
|
1160 |
-
return $content;
|
1161 |
}
|
1162 |
|
1163 |
// set a timeout until new mails are possible
|
1164 |
function shariff3UU_limitRemoteUser() {
|
1165 |
// options
|
1166 |
$shariff3UU_mailform = $GLOBALS["shariff3UU_mailform"];
|
1167 |
-
|
1168 |
// rtzrtz: umgeschrieben aus dem DOS-Blocker. Nochmal gruebeln, ob wir das ohne memcache mit der Performance schaffen. Daher auch nur Grundfunktionalitaet.
|
1169 |
-
if ( ! isset( $shariff3UU_mailform['REMOTEHOSTS'] ) )
|
|
|
|
|
1170 |
$HOSTS = json_decode( $shariff3UU_mailform['REMOTEHOSTS'], true );
|
1171 |
|
1172 |
-
//
|
1173 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1174 |
if ( $HOSTS[$_SERVER['REMOTE_ADDR']]-time()+$wait > 0 ) {
|
1175 |
if ( $HOSTS[$_SERVER['REMOTE_ADDR']]-time() < 86400 ) {
|
1176 |
$wait = ($HOSTS[$_SERVER['REMOTE_ADDR']]-time()+$wait)*2;
|
1177 |
}
|
1178 |
}
|
1179 |
-
|
1180 |
$HOSTS[$_SERVER['REMOTE_ADDR']] = time()+$wait;
|
1181 |
|
1182 |
// etwas Muellentsorgung
|
@@ -1193,7 +1234,7 @@ function shariff3UU_limitRemoteUser() {
|
|
1193 |
$shariff3UU_mailform['REMOTEHOSTS'] = $REMOTEHOSTS;
|
1194 |
|
1195 |
// update nur, wenn wir nicht unter heftigen DOS liegen
|
1196 |
-
if ( $HOSTS[$_SERVER['REMOTE_ADDR']]-time() < '60' ) {
|
1197 |
update_option( 'shariff3UU_mailform', $shariff3UU_mailform );
|
1198 |
}
|
1199 |
|
3 |
* Plugin Name: Shariff Wrapper
|
4 |
* Plugin URI: https://de.wordpress.org/plugins/shariff/
|
5 |
* Description: The Shariff Wrapper provides share buttons that respect the privacy of your visitors and are compliant to the German data protection laws.
|
6 |
+
* Version: 4.2.0
|
7 |
* Author: Jan-Peter Lambeck & 3UU
|
8 |
* Author URI: https://de.wordpress.org/plugins/shariff/
|
9 |
* License: MIT
|
26 |
// update function to perform tasks _once_ after an update, based on version number to work for automatic as well as manual updates
|
27 |
function shariff3UU_update() {
|
28 |
/******************** ADJUST VERSION ********************/
|
29 |
+
$code_version = "4.2.0"; // set code version - needs to be adjusted for every new version!
|
30 |
/******************** ADJUST VERSION ********************/
|
31 |
|
32 |
// get options
|
69 |
include( plugin_dir_path( __FILE__ ) . 'admin/admin_notices.php' );
|
70 |
}
|
71 |
|
72 |
+
// waiting for WordPress core to handle the saving of the dismiss click themself
|
73 |
+
function shariff3UU_dismiss_update_notice() {
|
74 |
+
update_option( 'shariff3UU_hide_update_notice', 'hide' );
|
75 |
+
}
|
76 |
+
add_action( 'wp_ajax_shariffdismiss', 'shariff3UU_dismiss_update_notice' );
|
77 |
+
|
78 |
// add meta links on plugin page
|
79 |
function shariff3UU_meta_links( $links, $file ) {
|
80 |
$plugin = plugin_basename(__FILE__);
|
116 |
$shariff3UU = $GLOBALS["shariff3UU"];
|
117 |
|
118 |
// parameters
|
119 |
+
$url = urldecode( $request['url'] );
|
120 |
$services = $request['services'];
|
121 |
$timestamp = $request['timestamp'];
|
122 |
|
474 |
}
|
475 |
add_filter( 'the_excerpt', 'shariff3UU_excerpt' );
|
476 |
|
477 |
+
// remove hideshariff from content in cases of excerpts or other plain text usages
|
478 |
+
function shariff3UU_hideshariff( $content ) {
|
479 |
+
if ( ( strpos( $content, 'hideshariff' ) == true ) ) {
|
480 |
+
// remove the sign
|
481 |
+
$content = str_replace( "hideshariff", "", $content );
|
482 |
+
}
|
483 |
+
return $content;
|
484 |
+
}
|
485 |
+
add_filter( 'the_content', 'shariff3UU_hideshariff', 999 );
|
486 |
+
|
487 |
// add mailform to bbpress_replies
|
488 |
function bbp_add_mailform_to_bbpress_replies() {
|
489 |
$content = '';
|
644 |
// add information for share count request
|
645 |
if ( array_key_exists( 'backend', $atts ) && $atts['backend'] == "on" ) {
|
646 |
// share url
|
647 |
+
$output .= ' data-url="' . esc_html( $share_url ) . '"';
|
648 |
// timestamp for cache
|
649 |
$output .= ' data-timestamp="' . absint( get_the_modified_date( 'U', true ) ) . '"';
|
650 |
// add external api if entered
|
659 |
elseif ( ! get_option('permalink_structure') ) {
|
660 |
$output .= ' data-backendurl="?rest_route=/shariff/v1/share_counts&"';
|
661 |
}
|
662 |
+
// else use the home url
|
663 |
+
else {
|
664 |
+
$output .= ' data-backendurl="' . rtrim( home_url(), "/" ) . '/wp-json/shariff/v1/share_counts?' . '"';
|
665 |
+
}
|
666 |
}
|
667 |
$output .= '>';
|
668 |
|
768 |
$button_text_array = '';
|
769 |
|
770 |
// build the actual button
|
771 |
+
$output .= '<a href="' . $button_url . '" title="' . $button_title . '" aria-label="' . $button_title . '" role="button" rel="noopener noreferrer nofollow" class="shariff-link" ';
|
772 |
// same window?
|
773 |
if ( ! isset( $same_window ) || isset( $same_window ) && $same_window != '1' ) $output .= 'target="_blank" ';
|
774 |
$output .= 'style="background-color:' . $main_color . $border_radius;
|
839 |
|
840 |
// if the service totalnumber is set, just output the total share count
|
841 |
if ( array_key_exists( '0', $service_array ) && $service_array['0'] == 'totalnumber' ) {
|
842 |
+
$output = '<span class="shariff" data-services="totalnumber" data-url="' . $share_url . '"';
|
843 |
// add external api
|
844 |
if ( isset( $shariff3UU["external_host"] ) && ! empty( $shariff3UU["external_host"] ) && isset( $shariff3UU["external_direct"] ) ) {
|
845 |
$output .= ' data-backendurl="' . $shariff3UU["external_host"] . '"';
|
871 |
return $content;
|
872 |
}
|
873 |
}
|
874 |
+
|
875 |
+
// only add filter if mailform is not disabled
|
876 |
+
if ( ! isset( $shariff3UU["disable_mailform"] ) || ( isset( $shariff3UU["disable_mailform"] ) && $shariff3UU["disable_mailform"] != '1' ) ) {
|
877 |
+
add_filter( 'the_content', 'shariff3UU_viewmail' );
|
878 |
+
}
|
879 |
|
880 |
// add mailform
|
881 |
function shariff3UU_addMailForm( $content, $error ) {
|
903 |
// if language is set to automatic try geoip
|
904 |
// http://datenverwurstungszentrale.com/stadt-und-land-mittels-geoip-ermitteln-268.htm
|
905 |
elseif ( function_exists('geoip_country_code_by_name') ) {
|
|
|
906 |
switch ( @geoip_country_code_by_name( $_SERVER[REMOTE_ADDR] ) ) {
|
907 |
case 'DE': $lang = 'DE';
|
908 |
break;
|
922 |
$lang = http_negotiate_language( $available_lang );
|
923 |
}
|
924 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
925 |
// include selected language
|
926 |
include( plugin_dir_path( __FILE__ ) . '/locale/mailform-' . $lang . '.php' );
|
927 |
|
979 |
<p><label for="mailto">' . $mf_rcpt[$lang] . '</label><br>
|
980 |
<input type="text" name="mailto" id="mailto" value="' . $mf_content_mailto . '" size="27" placeholder="' . $mf_rcpt_ph[$lang] . '" required>' . $mf_to_error_html . '</p>
|
981 |
<p><label for="from">' . $mf_from[$lang] . $mf_optional_text . '</label><br>
|
982 |
+
<input type="email" name="from" id="from" value="' . $mf_content_from . '" size="27" placeholder="' . $mf_from_ph[$lang] . '" ' . $mf_sender_required .'>' . $mf_from_error_html . '</p>
|
983 |
<p><label for="name">' . $mf_name[$lang] . '</label><br>
|
984 |
<input type="text" name="sender" id="sender" value="' . $mf_content_sender . '" size="27" placeholder="' . $mf_name_ph[$lang] . '"></p>
|
985 |
<p><label for="mail_comment">' . $mf_comment[$lang] . '</label><br>
|
986 |
<textarea name="mail_comment" rows="4">' . $mf_content_mail_comment . '</textarea></p>
|
987 |
+
<input type="url" name="url" id="shariff_mailform_url" value="" size="27" placeholder="">
|
988 |
</fieldset>
|
989 |
<p><input type="submit" class="shariff_mailform_submit" value="' . $mf_send[$lang] . '" /></p>
|
990 |
<p>' . $mf_info[$lang] . '</p>
|
1006 |
function sharif3UU_procSentMail( $content ) {
|
1007 |
// get options
|
1008 |
$shariff3UU = $GLOBALS["shariff3UU"];
|
1009 |
+
|
1010 |
+
// honeypot url input
|
1011 |
+
$mailform_url_field = sanitize_text_field( $_REQUEST['url'] );
|
1012 |
+
|
1013 |
+
// check if mailform is disabled
|
1014 |
+
if ( isset( $shariff3UU["disable_mailform"] ) && $shariff3UU["disable_mailform"] == '1' ) {
|
1015 |
+
return $content;
|
1016 |
+
}
|
1017 |
+
// check if url field has been filled
|
1018 |
+
elseif ( ! empty( $mailform_url_field ) ) {
|
1019 |
+
return $content;
|
1020 |
+
}
|
1021 |
+
else {
|
1022 |
+
// get vars from form
|
1023 |
+
$mf_nonce = sanitize_text_field( $_REQUEST['shariff_mf_nonce'] );
|
1024 |
+
$mf_content_mailto = sanitize_text_field( $_REQUEST['mailto'] );
|
1025 |
+
$mf_content_from = sanitize_text_field( $_REQUEST['from'] );
|
1026 |
+
$mf_content_sender = sanitize_text_field( $_REQUEST['sender'] );
|
1027 |
+
$mf_lang = sanitize_text_field( $_REQUEST['lang'] );
|
1028 |
+
|
1029 |
+
// clean up comments
|
1030 |
+
$mf_comment_content = $_REQUEST['mail_comment'] ;
|
1031 |
+
|
1032 |
+
// falls zauberhaft alte Serverkonfiguration, erstmal die Slashes entfernen...
|
1033 |
+
if ( get_magic_quotes_gpc() == 1 ) $mf_comment_content = stripslashes( $mf_comment_content );
|
1034 |
+
|
1035 |
+
// ...denn sonst kan wp_kses den content nicht entschaerfen
|
1036 |
+
$mf_comment_content = wp_kses( $mf_comment_content, '', '' );
|
1037 |
+
|
1038 |
+
// check if nonce is valid
|
1039 |
+
if ( isset( $mf_nonce ) && wp_verify_nonce( $mf_nonce, 'shariff3UU_send_mail' ) ) {
|
1040 |
+
// prevent double execution
|
1041 |
+
$_REQUEST['shariff_mf_nonce'] = '';
|
1042 |
+
|
1043 |
+
// field content to prefill forms in case of an error
|
1044 |
+
$error['mf_content_mailto'] = $mf_content_mailto;
|
1045 |
+
$error['mf_content_from'] = $mf_content_from;
|
1046 |
+
$error['mf_content_sender'] = $mf_content_sender;
|
1047 |
+
$error['mf_content_mail_comment'] = $mf_comment_content;
|
1048 |
+
|
1049 |
+
// get min wait time
|
1050 |
+
if ( isset( $shariff3UU["mailform_wait"] ) ) {
|
1051 |
+
$minwait = $shariff3UU["mailform_wait"];
|
1052 |
}
|
1053 |
+
else {
|
1054 |
+
$minwait = '5';
|
|
|
|
|
|
|
1055 |
}
|
1056 |
+
|
1057 |
+
// rate limiter
|
1058 |
+
$wait = shariff3UU_limitRemoteUser();
|
1059 |
+
if ( $wait > $minwait ) {
|
1060 |
+
$error['error'] = '1';
|
1061 |
+
$error['wait'] = $wait;
|
1062 |
}
|
1063 |
+
else {
|
1064 |
+
// nicer sender name and address
|
1065 |
+
if ( ! empty( $mf_content_sender ) ) {
|
1066 |
+
add_filter( 'wp_mail_from_name', 'shariff3UU_set_wp_mail_from_name' );
|
1067 |
+
}
|
1068 |
+
elseif ( ! empty( $mf_content_from ) ) {
|
1069 |
+
add_filter( 'wp_mail_from_name', 'shariff3UU_set2_wp_mail_from_name' );
|
1070 |
+
}
|
1071 |
+
elseif ( ! empty( $GLOBALS["shariff3UU_mailform"]["mail_sender_name"] ) ) {
|
1072 |
+
add_filter( 'wp_mail_from_name', 'shariff3UU_set3_wp_mail_from_name' );
|
1073 |
+
}
|
1074 |
+
else {
|
1075 |
+
add_filter( 'wp_mail_from_name', 'shariff3UU_set4_wp_mail_from_name' );
|
1076 |
+
}
|
1077 |
|
1078 |
+
// Achtung: NICHT die Absenderadresse selber umschreiben!
|
1079 |
+
// Das fuehrt bei allen sauber aufgesetzten Absender-MTAs zu Problemen mit SPF und/oder DKIM.
|
1080 |
+
|
1081 |
+
// default sender address
|
1082 |
+
if ( ! empty( $shariff3UU["mail_sender_from"] ) ) {
|
1083 |
+
add_filter( 'wp_mail_from', 'shariff3UU_set_wp_mail_from' );
|
1084 |
+
}
|
1085 |
|
1086 |
+
// build the array with recipients
|
1087 |
+
$arr = explode( ',', $mf_content_mailto );
|
1088 |
+
if ( $arr == FALSE ) $arr = array( $mf_content_mailto );
|
1089 |
+
// max 5
|
1090 |
+
for ( $i = 0; $i < count($arr); $i++ ) {
|
1091 |
+
if ( $i == '5' ) break;
|
1092 |
+
$tmp_mail = sanitize_email( $arr[$i] );
|
1093 |
+
// no need to add invalid stuff to the array
|
1094 |
+
if ( is_email( $tmp_mail ) != false ) {
|
1095 |
+
$mailto[] = $tmp_mail;
|
1096 |
+
}
|
1097 |
}
|
|
|
1098 |
|
1099 |
+
// set langugage from form
|
1100 |
+
if ( ! empty( $mf_lang ) ) {
|
1101 |
+
$lang = $mf_lang;
|
1102 |
+
}
|
1103 |
+
else {
|
1104 |
+
$lang ='EN';
|
1105 |
+
}
|
1106 |
|
1107 |
+
// fallback to EN if a language is not supported by this plugin translations
|
1108 |
+
if ( $lang != 'DE' && $lang != 'FR' && $lang != 'IT' ) { $lang = 'EN'; }
|
1109 |
|
1110 |
+
// include selected language
|
1111 |
+
include( plugin_dir_path( __FILE__ ) . '/locale/mailform-' . $lang . '.php' );
|
1112 |
|
1113 |
+
$subject = html_entity_decode( get_the_title(), ENT_COMPAT, 'UTF-8' );
|
1114 |
|
1115 |
+
// The following post was suggested to you by
|
1116 |
+
$message[ $lang ] = $mf_mailbody1[ $lang ];
|
1117 |
|
1118 |
+
if ( ! empty( $mf_content_sender ) ) {
|
1119 |
+
$message[ $lang ] .= $mf_content_sender;
|
1120 |
+
}
|
1121 |
+
elseif ( ! empty( $mf_content_from ) ) {
|
1122 |
+
$message[ $lang ] .= sanitize_text_field( $mf_content_from );
|
1123 |
+
}
|
1124 |
+
else {
|
1125 |
+
// somebody
|
1126 |
+
$message[ $lang ] .= $mf_mailbody2[ $lang ];
|
1127 |
+
}
|
1128 |
+
// :
|
1129 |
+
$message[ $lang ] .= $mf_mailbody3[ $lang ];
|
1130 |
|
1131 |
+
$message[ $lang ] .= " \r\n\r\n";
|
1132 |
+
$message[ $lang ] .= get_permalink() . "\r\n\r\n";
|
1133 |
|
1134 |
+
// add comment
|
1135 |
+
if ( ! empty( $mf_comment_content ) ) {
|
1136 |
+
$message[ $lang ] .= $mf_comment_content . "\r\n\r\n";
|
1137 |
+
}
|
1138 |
|
1139 |
+
// post content
|
1140 |
+
if ( isset( $shariff3UU["mail_add_post_content"] ) && $shariff3UU["mail_add_post_content"] == '1') {
|
1141 |
+
// strip all html tags
|
1142 |
+
$post_content = wordwrap( strip_tags( get_the_content() ), 72, "\r\n" );
|
1143 |
+
// strip all shortcodes
|
1144 |
+
$post_content = strip_shortcodes( $post_content );
|
1145 |
+
$message[ $lang ] .= $post_content;
|
1146 |
+
$message[ $lang ] .= " \r\n";
|
1147 |
+
}
|
1148 |
|
1149 |
+
$message[ $lang ] .= "\r\n-- \r\n";
|
1150 |
|
1151 |
+
// mail footer / disclaimer
|
1152 |
+
$message[ $lang ] .= $mf_footer[ $lang ];
|
1153 |
|
1154 |
+
// avoid auto-responder
|
1155 |
+
$headers = "Precedence: bulk\r\n";
|
1156 |
|
1157 |
+
// if sender address provided, set as return-path, elseif sender required set error
|
1158 |
+
if ( ! empty( $mf_content_from ) && is_email( $mf_content_from ) != false ) {
|
1159 |
+
$headers .= "Reply-To: <" . $mf_content_from . ">\r\n";
|
1160 |
+
}
|
1161 |
+
elseif ( isset( $shariff3UU["require_sender"] ) && $shariff3UU["require_sender"] == '1' ) {
|
1162 |
+
$error['error'] = '1';
|
1163 |
+
$error['from'] = '1';
|
1164 |
+
}
|
1165 |
|
1166 |
+
// set error, if no usuable recipient e-mail
|
1167 |
+
if ( empty( $mailto['0'] ) ) {
|
1168 |
+
$error['error'] = '1';
|
1169 |
+
$error['to'] = '1';
|
1170 |
+
}
|
|
|
|
|
1171 |
}
|
1172 |
+
// if we have errors provide the mailform again with error message
|
1173 |
+
if ( isset( $error['error'] ) && $error['error'] == '1' ) {
|
1174 |
+
$content = shariff3UU_addMailForm( $content, $error );
|
|
|
|
|
1175 |
}
|
1176 |
+
// if everything is fine, send the e-mail
|
1177 |
+
else {
|
1178 |
+
$mailnotice = '<div id="shariff_mailform" class="shariff_mailform">';
|
1179 |
+
// The e-mail was successfully send to:
|
1180 |
+
$mailnotice .= '<div class="shariff_mailform_headline">' . $mf_mail_send[ $lang ] . '<a href="' . get_permalink() . '" class="shariff_closeX"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><path d="M10 0c-5.5 0-10 4.5-10 10s4.5 10 10 10 10-4.5 10-10-4.5-10-10-10zM10 18.1c-4.5 0-8.1-3.6-8.1-8.1s3.6-8.1 8.1-8.1 8.1 3.6 8.1 8.1-3.6 8.1-8.1 8.1z"/><path d="M13.1 5l-3.1 3.1-3.1-3.1-1.9 1.9 3.1 3.1-3.1 3.1 1.9 1.9 3.1-3.1 3.1 3.1 1.9-1.9-3.1-3.1 3.1-3.1z"/></svg></a></div>';
|
1181 |
+
// send the mail ($mailto in this function is allways an array)
|
1182 |
+
foreach ( $mailto as $rcpt ) {
|
1183 |
+
wp_mail( $rcpt, $subject, $message["$lang"], $headers ); // the function is available after the hook 'plugins_loaded'
|
1184 |
+
$mailnotice .= $rcpt . '<br>';
|
1185 |
+
}
|
1186 |
+
$mailnotice .= '</div>';
|
1187 |
+
// add to content
|
1188 |
+
$content = $mailnotice . $content;
|
|
|
1189 |
}
|
|
|
|
|
|
|
1190 |
}
|
1191 |
+
return $content;
|
1192 |
}
|
|
|
1193 |
}
|
1194 |
|
1195 |
// set a timeout until new mails are possible
|
1196 |
function shariff3UU_limitRemoteUser() {
|
1197 |
// options
|
1198 |
$shariff3UU_mailform = $GLOBALS["shariff3UU_mailform"];
|
1199 |
+
|
1200 |
// rtzrtz: umgeschrieben aus dem DOS-Blocker. Nochmal gruebeln, ob wir das ohne memcache mit der Performance schaffen. Daher auch nur Grundfunktionalitaet.
|
1201 |
+
if ( ! isset( $shariff3UU_mailform['REMOTEHOSTS'] ) ) {
|
1202 |
+
$shariff3UU_mailform['REMOTEHOSTS'] = '';
|
1203 |
+
}
|
1204 |
$HOSTS = json_decode( $shariff3UU_mailform['REMOTEHOSTS'], true );
|
1205 |
|
1206 |
+
// get wait time
|
1207 |
+
if ( isset( $shariff3UU_mailform["mailform_wait"] ) ) {
|
1208 |
+
$wait = $shariff3UU_mailform["mailform_wait"];
|
1209 |
+
}
|
1210 |
+
else {
|
1211 |
+
$wait = '5';
|
1212 |
+
}
|
1213 |
+
|
1214 |
+
// calculate current wait time
|
1215 |
if ( $HOSTS[$_SERVER['REMOTE_ADDR']]-time()+$wait > 0 ) {
|
1216 |
if ( $HOSTS[$_SERVER['REMOTE_ADDR']]-time() < 86400 ) {
|
1217 |
$wait = ($HOSTS[$_SERVER['REMOTE_ADDR']]-time()+$wait)*2;
|
1218 |
}
|
1219 |
}
|
1220 |
+
|
1221 |
$HOSTS[$_SERVER['REMOTE_ADDR']] = time()+$wait;
|
1222 |
|
1223 |
// etwas Muellentsorgung
|
1234 |
$shariff3UU_mailform['REMOTEHOSTS'] = $REMOTEHOSTS;
|
1235 |
|
1236 |
// update nur, wenn wir nicht unter heftigen DOS liegen
|
1237 |
+
if ( $HOSTS[$_SERVER['REMOTE_ADDR']]-time()-$wait < '60' ) {
|
1238 |
update_option( 'shariff3UU_mailform', $shariff3UU_mailform );
|
1239 |
}
|
1240 |
|
uninstall.php
CHANGED
@@ -2,15 +2,7 @@
|
|
2 |
// delete options upon uninstall to prevent issues with other plugins and leaving trash behind
|
3 |
|
4 |
// exit, if uninstall.php was not called from WordPress
|
5 |
-
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) )
|
6 |
-
|
7 |
-
$option_name = 'shariff3UU';
|
8 |
-
$shariff3UU_basic = 'shariff3UU_basic';
|
9 |
-
$shariff3UU_design = 'shariff3UU_design';
|
10 |
-
$shariff3UU_advanced = 'shariff3UU_advanced';
|
11 |
-
$shariff3UU_mailform = 'shariff3UU_mailform';
|
12 |
-
$shariff3UU_statistic = 'shariff3UU_statistic';
|
13 |
-
$widget_name = 'widget_shariff';
|
14 |
|
15 |
// check for multisite
|
16 |
if ( is_multisite() ) {
|
@@ -21,20 +13,14 @@ if ( is_multisite() ) {
|
|
21 |
// switch to each blog
|
22 |
switch_to_blog( $blog['blog_id'] );
|
23 |
// delete options from options table
|
24 |
-
delete_option(
|
25 |
-
delete_option(
|
26 |
-
delete_option(
|
27 |
-
delete_option(
|
28 |
-
delete_option(
|
29 |
-
delete_option(
|
30 |
-
delete_option(
|
31 |
-
|
32 |
-
$users = get_users('role=administrator');
|
33 |
-
foreach ( $users as $user ) {
|
34 |
-
if ( ! get_user_meta( $user, 'shariff3UU_ignore_notice' ) ) {
|
35 |
-
delete_user_meta( $user->ID, 'shariff3UU_ignore_notice' );
|
36 |
-
}
|
37 |
-
};
|
38 |
// purge transients
|
39 |
purge_transients();
|
40 |
// remove cron job
|
@@ -45,20 +31,15 @@ if ( is_multisite() ) {
|
|
45 |
}
|
46 |
} else {
|
47 |
// delete options from options table
|
48 |
-
delete_option(
|
49 |
-
delete_option(
|
50 |
-
delete_option(
|
51 |
-
delete_option(
|
52 |
-
delete_option(
|
53 |
-
delete_option(
|
54 |
-
delete_option(
|
55 |
-
|
56 |
-
|
57 |
-
foreach ( $users as $user ) {
|
58 |
-
if ( ! get_user_meta( $user, 'shariff3UU_ignore_notice' ) ) {
|
59 |
-
delete_user_meta( $user->ID, 'shariff3UU_ignore_notice' );
|
60 |
-
}
|
61 |
-
};
|
62 |
// purge transients
|
63 |
purge_transients();
|
64 |
// remove cron job
|
@@ -68,13 +49,11 @@ if ( is_multisite() ) {
|
|
68 |
// purge all the transients associated with our plugin
|
69 |
function purge_transients() {
|
70 |
global $wpdb;
|
71 |
-
|
72 |
// delete transients
|
73 |
$sql = 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE "_transient_timeout_shariff%"';
|
74 |
$wpdb->query($sql);
|
75 |
$sql = 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE "_transient_shariff%"';
|
76 |
$wpdb->query($sql);
|
77 |
-
|
78 |
// clear object cache
|
79 |
wp_cache_flush();
|
80 |
}
|
2 |
// delete options upon uninstall to prevent issues with other plugins and leaving trash behind
|
3 |
|
4 |
// exit, if uninstall.php was not called from WordPress
|
5 |
+
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { die(); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
// check for multisite
|
8 |
if ( is_multisite() ) {
|
13 |
// switch to each blog
|
14 |
switch_to_blog( $blog['blog_id'] );
|
15 |
// delete options from options table
|
16 |
+
delete_option( 'shariff3UU' );
|
17 |
+
delete_option( 'shariff3UU_basic' );
|
18 |
+
delete_option( 'shariff3UU_design' );
|
19 |
+
delete_option( 'shariff3UU_advanced' );
|
20 |
+
delete_option( 'shariff3UU_mailform' );
|
21 |
+
delete_option( 'shariff3UU_statistic' );
|
22 |
+
delete_option( 'widget_shariff' );
|
23 |
+
delete_option( 'shariff3UU_hide_update_notice' );
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
// purge transients
|
25 |
purge_transients();
|
26 |
// remove cron job
|
31 |
}
|
32 |
} else {
|
33 |
// delete options from options table
|
34 |
+
delete_option( 'shariff3UU' );
|
35 |
+
delete_option( 'shariff3UU_basic' );
|
36 |
+
delete_option( 'shariff3UU_design' );
|
37 |
+
delete_option( 'shariff3UU_advanced' );
|
38 |
+
delete_option( 'shariff3UU_mailform' );
|
39 |
+
delete_option( 'shariff3UU_statistic' );
|
40 |
+
delete_option( 'widget_shariff' );
|
41 |
+
delete_option( 'shariff3UU_hide_update_notice' );
|
42 |
+
delete_option( 'shariff3UU_hide_update_notice' );
|
|
|
|
|
|
|
|
|
|
|
43 |
// purge transients
|
44 |
purge_transients();
|
45 |
// remove cron job
|
49 |
// purge all the transients associated with our plugin
|
50 |
function purge_transients() {
|
51 |
global $wpdb;
|
|
|
52 |
// delete transients
|
53 |
$sql = 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE "_transient_timeout_shariff%"';
|
54 |
$wpdb->query($sql);
|
55 |
$sql = 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE "_transient_shariff%"';
|
56 |
$wpdb->query($sql);
|
|
|
57 |
// clear object cache
|
58 |
wp_cache_flush();
|
59 |
}
|
updates.php
CHANGED
@@ -2,17 +2,12 @@
|
|
2 |
/**
|
3 |
* Will be included by shariff3UU_update() only if needed.
|
4 |
* Put all update task here and feel free to split files per update, but make sure that all "older" updates are checked first.
|
5 |
-
* To enable an admin notice please set $do_admin_notice = true; at any point during your update routine.
|
6 |
-
* The admin notice needs to be configured in admin_notices.php.
|
7 |
* At least you must set $GLOBALS["shariff3UU"]["version"] = [YOUR VERSION]; to avoid includes later on.
|
8 |
*/
|
9 |
|
10 |
// prevent direct calls to updates.php
|
11 |
if ( ! class_exists('WP') ) { die(); }
|
12 |
|
13 |
-
// default is false, unless it is set to true in one of the update routines
|
14 |
-
$do_admin_notice = false;
|
15 |
-
|
16 |
// Migration < v 1.7
|
17 |
if ( isset( $GLOBALS["shariff3UU"]["version"] ) && version_compare( $GLOBALS["shariff3UU"]["version"], '1.7' ) == '-1' ) {
|
18 |
if ( isset($GLOBALS["shariff3UU"]["add_all"] ) ) {
|
@@ -240,43 +235,46 @@ if ( isset( $GLOBALS["shariff3UU"]["version"] ) && version_compare( $GLOBALS["sh
|
|
240 |
$GLOBALS["shariff3UU"]["version"] = '4.0.0';
|
241 |
}
|
242 |
|
243 |
-
//
|
244 |
-
|
245 |
-
//
|
246 |
-
|
247 |
-
// make sure we have the $wpdb class ready
|
248 |
-
global $wpdb;
|
249 |
|
250 |
-
// delete user meta entry shariff3UU_ignore_notice to display update message again after an update (check for multisite)
|
251 |
-
if ( is_multisite()
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
|
|
267 |
}
|
268 |
-
}
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
}
|
277 |
}
|
278 |
}
|
279 |
|
|
|
|
|
|
|
|
|
280 |
// purge transients (check for multisite)
|
281 |
if ( is_multisite() ) {
|
282 |
$current_blog_id = get_current_blog_id();
|
@@ -314,6 +312,9 @@ function shariff3UU_purge_transients() {
|
|
314 |
wp_clear_scheduled_hook( 'shariff3UU_fill_cache' );
|
315 |
do_action( 'shariff3UU_save_statistic_options' );
|
316 |
|
|
|
|
|
|
|
317 |
// set new version
|
318 |
$GLOBALS["shariff3UU"]["version"] = $code_version;
|
319 |
$GLOBALS["shariff3UU_basic"]["version"] = $code_version;
|
2 |
/**
|
3 |
* Will be included by shariff3UU_update() only if needed.
|
4 |
* Put all update task here and feel free to split files per update, but make sure that all "older" updates are checked first.
|
|
|
|
|
5 |
* At least you must set $GLOBALS["shariff3UU"]["version"] = [YOUR VERSION]; to avoid includes later on.
|
6 |
*/
|
7 |
|
8 |
// prevent direct calls to updates.php
|
9 |
if ( ! class_exists('WP') ) { die(); }
|
10 |
|
|
|
|
|
|
|
11 |
// Migration < v 1.7
|
12 |
if ( isset( $GLOBALS["shariff3UU"]["version"] ) && version_compare( $GLOBALS["shariff3UU"]["version"], '1.7' ) == '-1' ) {
|
13 |
if ( isset($GLOBALS["shariff3UU"]["add_all"] ) ) {
|
235 |
$GLOBALS["shariff3UU"]["version"] = '4.0.0';
|
236 |
}
|
237 |
|
238 |
+
// Migration < v 4.2
|
239 |
+
if ( isset( $GLOBALS["shariff3UU"]["version"] ) && version_compare( $GLOBALS["shariff3UU"]["version"], '4.2.0' ) == '-1' ) {
|
240 |
+
// make sure we have the $wpdb class ready
|
241 |
+
global $wpdb;
|
|
|
|
|
242 |
|
243 |
+
// delete user meta entry shariff3UU_ignore_notice to display update message again after an update (check for multisite)
|
244 |
+
if ( is_multisite() ) {
|
245 |
+
$current_blog_id = get_current_blog_id();
|
246 |
+
$blogs = $wpdb->get_results( "SELECT blog_id FROM {$wpdb->blogs}", ARRAY_A );
|
247 |
+
if ( $blogs ) {
|
248 |
+
foreach ( $blogs as $blog ) {
|
249 |
+
// switch to each blog
|
250 |
+
switch_to_blog( $blog['blog_id'] );
|
251 |
+
// delete user meta entry shariff3UU_ignore_notice
|
252 |
+
$users = get_users( 'role=administrator' );
|
253 |
+
foreach ( $users as $user ) {
|
254 |
+
if ( get_user_meta( $user -> ID, 'shariff3UU_ignore_notice', true ) ) {
|
255 |
+
delete_user_meta( $user -> ID, 'shariff3UU_ignore_notice' );
|
256 |
+
}
|
257 |
+
}
|
258 |
+
// switch back to main
|
259 |
+
restore_current_blog();
|
260 |
+
}
|
261 |
}
|
262 |
+
}
|
263 |
+
else {
|
264 |
+
// delete user meta entry shariff3UU_ignore_notice
|
265 |
+
$users = get_users( 'role=administrator' );
|
266 |
+
foreach ( $users as $user ) {
|
267 |
+
if ( get_user_meta( $user -> ID, 'shariff3UU_ignore_notice', true ) ) {
|
268 |
+
delete_user_meta( $user -> ID, 'shariff3UU_ignore_notice' );
|
269 |
+
}
|
270 |
}
|
271 |
}
|
272 |
}
|
273 |
|
274 |
+
// future update routines go here!
|
275 |
+
|
276 |
+
// general tasks we do on every update, like clean up transients and so on
|
277 |
+
|
278 |
// purge transients (check for multisite)
|
279 |
if ( is_multisite() ) {
|
280 |
$current_blog_id = get_current_blog_id();
|
312 |
wp_clear_scheduled_hook( 'shariff3UU_fill_cache' );
|
313 |
do_action( 'shariff3UU_save_statistic_options' );
|
314 |
|
315 |
+
// remove hide update notice setting
|
316 |
+
delete_option( 'shariff3UU_hide_update_notice' );
|
317 |
+
|
318 |
// set new version
|
319 |
$GLOBALS["shariff3UU"]["version"] = $code_version;
|
320 |
$GLOBALS["shariff3UU_basic"]["version"] = $code_version;
|