├── icon-256x256.png ├── banner-800x150.png ├── snippets ├── ppc_pvc.zip ├── ppc_wp_slimstat.zip ├── ppc_shortcode_stripper.zip └── ppcp_pb_exclude_days.php.zip ├── style ├── images │ ├── pro.png │ ├── black.png │ ├── info.png │ ├── minus.png │ ├── plus.png │ ├── star.png │ ├── write.png │ ├── dollar.png │ ├── feedback.png │ ├── paypal.png │ ├── warning.png │ ├── ajax-loader.gif │ └── screenshots │ │ ├── stats.png │ │ ├── pro_stats.png │ │ ├── misc_settings.png │ │ └── counting_settings.png ├── ui-lightness │ ├── jquery.ui.base.css │ ├── images │ │ ├── ui-icons_222222_256x240.png │ │ ├── ui-icons_228ef1_256x240.png │ │ ├── ui-icons_ef8c08_256x240.png │ │ ├── ui-icons_ffd27a_256x240.png │ │ ├── ui-icons_ffffff_256x240.png │ │ ├── ui-bg_flat_10_000000_40x100.png │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ ├── ui-bg_glass_100_f6f6f6_1x400.png │ │ ├── ui-bg_glass_100_fdf5ce_1x400.png │ │ ├── ui-bg_gloss-wave_35_f6a828_500x100.png │ │ ├── ui-bg_diagonals-thick_18_b81900_40x40.png │ │ ├── ui-bg_diagonals-thick_20_666666_40x40.png │ │ ├── ui-bg_highlight-soft_100_eeeeee_1x100.png │ │ └── ui-bg_highlight-soft_75_ffe45c_1x100.png │ ├── jquery.ui.all.css │ ├── jquery.ui.core.css │ ├── jquery.ui.datepicker.css │ └── jquery.ui.theme.css ├── ppc_welcome_style.css ├── ppc_addons_style.css ├── ppc_header_style.css ├── ppc_options_style_old.css ├── ppc_options_style.css ├── ppc_stats_style.css └── tipTip.css ├── lang ├── post-pay-counter-ar_AE.mo ├── post-pay-counter-cs_CZ.mo ├── post-pay-counter-de_DE.mo ├── post-pay-counter-es_ES.mo ├── post-pay-counter-fr_FR.mo ├── post-pay-counter-it_IT.mo ├── post-pay-counter-nl_NL.mo ├── post-pay-counter-pl_PL.mo ├── post-pay-counter-pt_BR.mo ├── post-pay-counter-pt_PT.mo ├── post-pay-counter-ru_RU.mo └── post-pay-counter-tr_TR.mo ├── uninstall.php ├── classes ├── ppc_permissions_class.php ├── ppc_notifications_class.php ├── ppc_visits_trackers.php ├── ppc_error_class.php ├── ppc_system_info_class.php ├── ppc_cache_class.php ├── ppc_license_class.php ├── ppc_autoupdate_class.php ├── ppc_addons_class.php ├── ppc_update_class.php ├── ppc_options_fields_class.php ├── ppc_install_functions_class.php ├── ppc_ajax_functions_class.php ├── ppc_welcome_class.php ├── ppc_counting_types_class.php └── ppc_general_functions_class.php ├── .gitignore ├── js ├── ppc_stats_effects.js ├── jquery.tiptip.min.js ├── ppc_options_effects.js └── ppc_options_ajax_stuff.js └── wp-cli.php /icon-256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/icon-256x256.png -------------------------------------------------------------------------------- /banner-800x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/banner-800x150.png -------------------------------------------------------------------------------- /snippets/ppc_pvc.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/snippets/ppc_pvc.zip -------------------------------------------------------------------------------- /style/images/pro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/style/images/pro.png -------------------------------------------------------------------------------- /style/images/black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/style/images/black.png -------------------------------------------------------------------------------- /style/images/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/style/images/info.png -------------------------------------------------------------------------------- /style/images/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/style/images/minus.png -------------------------------------------------------------------------------- /style/images/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/style/images/plus.png -------------------------------------------------------------------------------- /style/images/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/style/images/star.png -------------------------------------------------------------------------------- /style/images/write.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/style/images/write.png -------------------------------------------------------------------------------- /style/images/dollar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/style/images/dollar.png -------------------------------------------------------------------------------- /style/images/feedback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/style/images/feedback.png -------------------------------------------------------------------------------- /style/images/paypal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/style/images/paypal.png -------------------------------------------------------------------------------- /style/images/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/style/images/warning.png -------------------------------------------------------------------------------- /style/ui-lightness/jquery.ui.base.css: -------------------------------------------------------------------------------- 1 | @import url("jquery.ui.core.css"); 2 | @import url("jquery.ui.datepicker.css"); -------------------------------------------------------------------------------- /lang/post-pay-counter-ar_AE.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/lang/post-pay-counter-ar_AE.mo -------------------------------------------------------------------------------- /lang/post-pay-counter-cs_CZ.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/lang/post-pay-counter-cs_CZ.mo -------------------------------------------------------------------------------- /lang/post-pay-counter-de_DE.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/lang/post-pay-counter-de_DE.mo -------------------------------------------------------------------------------- /lang/post-pay-counter-es_ES.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/lang/post-pay-counter-es_ES.mo -------------------------------------------------------------------------------- /lang/post-pay-counter-fr_FR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/lang/post-pay-counter-fr_FR.mo -------------------------------------------------------------------------------- /lang/post-pay-counter-it_IT.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/lang/post-pay-counter-it_IT.mo -------------------------------------------------------------------------------- /lang/post-pay-counter-nl_NL.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/lang/post-pay-counter-nl_NL.mo -------------------------------------------------------------------------------- /lang/post-pay-counter-pl_PL.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/lang/post-pay-counter-pl_PL.mo -------------------------------------------------------------------------------- /lang/post-pay-counter-pt_BR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/lang/post-pay-counter-pt_BR.mo -------------------------------------------------------------------------------- /lang/post-pay-counter-pt_PT.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/lang/post-pay-counter-pt_PT.mo -------------------------------------------------------------------------------- /lang/post-pay-counter-ru_RU.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/lang/post-pay-counter-ru_RU.mo -------------------------------------------------------------------------------- /lang/post-pay-counter-tr_TR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/lang/post-pay-counter-tr_TR.mo -------------------------------------------------------------------------------- /snippets/ppc_wp_slimstat.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/snippets/ppc_wp_slimstat.zip -------------------------------------------------------------------------------- /style/images/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/style/images/ajax-loader.gif -------------------------------------------------------------------------------- /snippets/ppc_shortcode_stripper.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/snippets/ppc_shortcode_stripper.zip -------------------------------------------------------------------------------- /style/images/screenshots/stats.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/style/images/screenshots/stats.png -------------------------------------------------------------------------------- /snippets/ppcp_pb_exclude_days.php.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/snippets/ppcp_pb_exclude_days.php.zip -------------------------------------------------------------------------------- /style/images/screenshots/pro_stats.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/style/images/screenshots/pro_stats.png -------------------------------------------------------------------------------- /style/images/screenshots/misc_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/style/images/screenshots/misc_settings.png -------------------------------------------------------------------------------- /style/ppc_welcome_style.css: -------------------------------------------------------------------------------- 1 | .ppc-welcome-screenshots { 2 | float: right; 3 | margin-left: 10px !important; 4 | width: 400px !important; 5 | } 6 | -------------------------------------------------------------------------------- /style/images/screenshots/counting_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/style/images/screenshots/counting_settings.png -------------------------------------------------------------------------------- /style/ui-lightness/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/style/ui-lightness/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /style/ui-lightness/images/ui-icons_228ef1_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/style/ui-lightness/images/ui-icons_228ef1_256x240.png -------------------------------------------------------------------------------- /style/ui-lightness/images/ui-icons_ef8c08_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/style/ui-lightness/images/ui-icons_ef8c08_256x240.png -------------------------------------------------------------------------------- /style/ui-lightness/images/ui-icons_ffd27a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/style/ui-lightness/images/ui-icons_ffd27a_256x240.png -------------------------------------------------------------------------------- /style/ui-lightness/images/ui-icons_ffffff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/style/ui-lightness/images/ui-icons_ffffff_256x240.png -------------------------------------------------------------------------------- /style/ui-lightness/images/ui-bg_flat_10_000000_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/style/ui-lightness/images/ui-bg_flat_10_000000_40x100.png -------------------------------------------------------------------------------- /style/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/style/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /style/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/style/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png -------------------------------------------------------------------------------- /style/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/style/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png -------------------------------------------------------------------------------- /style/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/style/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png -------------------------------------------------------------------------------- /style/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/style/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png -------------------------------------------------------------------------------- /style/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/style/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png -------------------------------------------------------------------------------- /style/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/style/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png -------------------------------------------------------------------------------- /style/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCrowned/Post-Pay-Counter/HEAD/style/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png -------------------------------------------------------------------------------- /style/ui-lightness/jquery.ui.all.css: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery UI CSS Framework 1.8.15 3 | * 4 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 5 | * Dual licensed under the MIT or GPL Version 2 licenses. 6 | * http://jquery.org/license 7 | * 8 | * http://docs.jquery.com/UI/Theming 9 | */ 10 | @import "jquery.ui.base.css"; 11 | @import "jquery.ui.theme.css"; 12 | -------------------------------------------------------------------------------- /style/ppc_addons_style.css: -------------------------------------------------------------------------------- 1 | #ppc_addons h2 { 2 | margin: 0 0 15px; 3 | } 4 | #ppc_addons .ppc_addon { 5 | float: left; 6 | margin: 0 15px 15px 0; 7 | background: #f0f0f0; 8 | border: 1px solid #ccc; 9 | width: 320px; 10 | padding: 8px; 11 | height: 315px; 12 | position: relative; 13 | } 14 | #ppc_addons .ppc_addon h3 { 15 | margin: 0 0 8px; 16 | font-size: 13px; 17 | } 18 | #ppc_addons .ppc_addon img { 19 | width: 320px; 20 | height: 200px; 21 | object-fit: contain; 22 | } 23 | #ppc_addons .ppc_addon .button-secondary { 24 | position: absolute; 25 | bottom: 8px; 26 | } 27 | -------------------------------------------------------------------------------- /style/ppc_header_style.css: -------------------------------------------------------------------------------- 1 | #ppc_logo { 2 | float: right; 3 | width: 11%; 4 | margin-top: 23px; 5 | margin-right: -10%; 6 | margin-bottom: 3px; 7 | text-align: center; 8 | } 9 | #ppc_logo img { 10 | width: 160px; 11 | } 12 | #ppc_logo_caption { 13 | text-transform: uppercase; 14 | font-size: smaller; 15 | margin-top: -5px; 16 | text-align: center; 17 | } 18 | #ppc_logo_caption a, #ppc_logo_caption a:link, #ppc_logo_caption a:visited { 19 | color: inherit; 20 | } 21 | #ppc_header { 22 | float: left; 23 | 24 | margin-bottom: 5px; 25 | } 26 | #ppc_header_links { 27 | float: right; 28 | color: #777; 29 | margin-top: 5px; 30 | } 31 | #ppc_header_text { 32 | float: left; 33 | } -------------------------------------------------------------------------------- /style/ppc_options_style_old.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Deprecated styles. Use ppc- prefixed classes. 3 | */ 4 | 5 | .section { 6 | border-left-width: 1px; 7 | border-left-style: dashed; 8 | border-left-color: gray; 9 | padding-left: 10px; 10 | margin-bottom: 2.2em; 11 | } 12 | .section .title { 13 | font-weight: bold; 14 | text-align: left; 15 | margin-bottom: -5px; 16 | margin-top: 20px; 17 | } 18 | .section .content { 19 | margin-left: 1.5em; 20 | } 21 | .section .field_value { 22 | margin-left: 1.5em; 23 | } 24 | .section input[type="text"] { 25 | float: right; 26 | } 27 | .section td { 28 | width: 50%; 29 | } 30 | .save_settings { 31 | float: right; 32 | width: 30%; 33 | } 34 | .save_settings input { 35 | float: right; 36 | } 37 | .ajax_loader { 38 | display: none; 39 | float: left; 40 | margin-right: 5px; 41 | } 42 | -------------------------------------------------------------------------------- /uninstall.php: -------------------------------------------------------------------------------- 1 | get_col( 'SELECT blog_id FROM '.$wpdb->blogs ); 40 | foreach( $blog_ids as $blog_id ) { 41 | switch_to_blog( $blog_id ); 42 | ppc_uninstall_procedure(); 43 | } 44 | 45 | restore_current_blog(); 46 | return; 47 | } 48 | 49 | ppc_uninstall_procedure(); 50 | -------------------------------------------------------------------------------- /classes/ppc_permissions_class.php: -------------------------------------------------------------------------------- 1 | ID; 28 | 29 | $settings = PPC_general_functions::get_settings( $user ); 30 | 31 | //Admins override permissions, unless they have that permission turned off 32 | if( $settings['admins_override_permissions'] AND current_user_can( $ppc_global_settings['cap_manage_options'] ) ) { 33 | $user_only_settings = PPC_general_functions::get_settings( $user, false, false ); 34 | if ( ! ( $user_only_settings['userid'] != 'general' AND isset( $user_only_settings[$permission] ) AND ! $user_only_settings[$permission] ) ) // if user does not have this specific permission turned off 35 | return true; 36 | } 37 | 38 | return (bool) $settings[$permission]; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /style/ui-lightness/jquery.ui.core.css: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery UI CSS Framework 1.8.15 3 | * 4 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 5 | * Dual licensed under the MIT or GPL Version 2 licenses. 6 | * http://jquery.org/license 7 | * 8 | * http://docs.jquery.com/UI/Theming/API 9 | */ 10 | 11 | /* Layout helpers 12 | ----------------------------------*/ 13 | .ui-helper-hidden { display: none; } 14 | .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } 15 | .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } 16 | .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } 17 | .ui-helper-clearfix { display: inline-block; } 18 | /* required comment for clearfix to work in Opera \*/ 19 | * html .ui-helper-clearfix { height:1%; } 20 | .ui-helper-clearfix { display:block; } 21 | /* end clearfix */ 22 | .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } 23 | 24 | 25 | /* Interaction Cues 26 | ----------------------------------*/ 27 | .ui-state-disabled { cursor: default !important; } 28 | 29 | 30 | /* Icons 31 | ----------------------------------*/ 32 | 33 | /* states and images */ 34 | .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } 35 | 36 | 37 | /* Misc visuals 38 | ----------------------------------*/ 39 | 40 | /* Overlays */ 41 | .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } 42 | -------------------------------------------------------------------------------- /style/ppc_options_style.css: -------------------------------------------------------------------------------- 1 | #side-info-column { 2 | width: 49%; 3 | } 4 | .inner-sidebar #side-sortables { 5 | width: 100%; 6 | } 7 | .has-right-sidebar #post-body-content { 8 | width: 49%; 9 | margin-right: 390px; 10 | } 11 | .has-right-sidebar #post-body { 12 | margin-right: -50%; 13 | } 14 | #post-body #normal-sortables { 15 | width: 100%; 16 | } 17 | .ppc_section { 18 | border-left-width: 1px; 19 | border-left-style: dashed; 20 | border-left-color: gray; 21 | padding-left: 10px; 22 | margin-bottom: 2.2em; 23 | } 24 | .ppc_section .ppc_title { 25 | font-weight: bold; 26 | text-align: left; 27 | margin-bottom: -5px; 28 | margin-top: 20px; 29 | } 30 | .ppc_section .ppc_content { 31 | margin-left: 1.5em; 32 | } 33 | .ppc_section .ppc_field_value { 34 | margin-left: 1.5em; 35 | } 36 | .ppc_section input[type="text"] { 37 | float: right; 38 | background-color: #eee; 39 | margin-right: 2em; 40 | } 41 | .ppc_section select { 42 | float: right; 43 | background-color: #eee; 44 | margin-right: 0.5em; 45 | } 46 | .ppc_section td { 47 | width: 50%; 48 | } 49 | .ppc_tooltip { 50 | float: right; 51 | width: 20px; 52 | text-align: right; 53 | } 54 | .ppc_save_settings { 55 | float: right; 56 | width: 30%; 57 | } 58 | .ppc_save_settings input { 59 | float: right; 60 | } 61 | .ppc_align_right { 62 | float: right; 63 | } 64 | .ppc_ajax_loader { 65 | display: none; 66 | float: left; 67 | margin-right: 5px; 68 | } 69 | .ppc_save_success { 70 | display: none; 71 | float: left; 72 | width: 70%; 73 | padding: 5px; 74 | background: #BCED91; 75 | border-style: solid; 76 | border-width: 1px; 77 | border-color: #567E3A; 78 | } 79 | .ppc_save_error { 80 | display: none; 81 | float: left; 82 | width: 70%; 83 | padding: 5px; 84 | background: #FF6060; 85 | border-style: solid; 86 | border-width: 1px; 87 | border-color: #C12B45; 88 | } 89 | #ppc_personalize_users { 90 | max-height: 12em; 91 | overflow: auto; 92 | display: none; 93 | } 94 | .ppc_copy_license_key { 95 | font-size: x-small; 96 | color: grey; 97 | } 98 | -------------------------------------------------------------------------------- /style/ppc_stats_style.css: -------------------------------------------------------------------------------- 1 | #ppc_logo { 2 | margin-right: 0px; 3 | margin-top: -5px; 4 | width: 11%; 5 | padding-left: 30px; 6 | } 7 | #ppc_logo img { 8 | width: 100px; 9 | } 10 | 11 | .ppc_error { 12 | display: none; 13 | color: red; 14 | font-weight: bold; 15 | float: left; 16 | width: 70%; 17 | } 18 | .ppc_success { 19 | display: none; 20 | color: green; 21 | font-weight: bold; 22 | float: left; 23 | width: 70%; 24 | } 25 | .ppc_ajax_loader { 26 | display: none; 27 | } 28 | .ppc_table_divider { 29 | margin-top: 15px; 30 | height: 1px; 31 | clear: both; 32 | } 33 | .ppc_hr_divider { 34 | border-color: #ccc; 35 | border-style: solid; 36 | border-width: 1px 0 0; 37 | clear: both; 38 | margin: 5px 0 20px; 39 | height: 0; 40 | } 41 | 42 | @media screen and (max-width: 500px) { 43 | abbr[title].ppc_payment_column { 44 | position: relative; 45 | text-decoration: underline dotted; 46 | } 47 | abbr[title].ppc_payment_column:hover::after, 48 | abbr[title].ppc_payment_column:focus::after { 49 | content: attr(title); 50 | 51 | /* position tooltip like the native one */ 52 | /*position: absolute; 53 | left: 0; 54 | bottom: -30px; 55 | width: auto; 56 | white-space: nowrap;*/ 57 | 58 | /* style tooltip */ 59 | bottom: -30px; 60 | background-color: #1e1e1e; 61 | color: #fff; 62 | border-radius: 3px; 63 | box-shadow: 1px 1px 5px 0 rgba(0,0,0,0.4); 64 | font-size: 14px; 65 | padding: 3px 5px; 66 | } 67 | } 68 | 69 | .ppc_payment_column { 70 | border-bottom: 1px dotted; 71 | color: #000000; 72 | }*/ 73 | .ppc_count_column { 74 | border-bottom: 1px dotted; 75 | } 76 | #ppc_stats_header { 77 | height: 50px; 78 | } 79 | #ppc_stats_header_datepicker { 80 | float: left; 81 | text-align: left; 82 | } 83 | #ppc_stats_header_datepicker h3 { 84 | margin: 10px 0px 5px; 85 | } 86 | #ppc_stats_header_features { 87 | float: right; 88 | text-align: right; 89 | width: 20%; 90 | min-width: 30em; 91 | } 92 | #ppc_stats_header_features a { 93 | font-size: smaller; 94 | } 95 | #ppc_stats_header_links { 96 | float: right; 97 | height: 100%; 98 | border-left: 1px solid; 99 | border-color: #ccc; 100 | margin-left: 5%; 101 | padding-left: 5%; 102 | } 103 | -------------------------------------------------------------------------------- /style/tipTip.css: -------------------------------------------------------------------------------- 1 | /* TipTip CSS - Version 1.2 */ 2 | 3 | #tiptip_holder { 4 | display: none; 5 | position: absolute; 6 | top: 0; 7 | left: 0; 8 | z-index: 99999; 9 | } 10 | 11 | #tiptip_holder.tip_top { 12 | padding-bottom: 5px; 13 | } 14 | 15 | #tiptip_holder.tip_bottom { 16 | padding-top: 5px; 17 | } 18 | 19 | #tiptip_holder.tip_right { 20 | padding-left: 5px; 21 | } 22 | 23 | #tiptip_holder.tip_left { 24 | padding-right: 5px; 25 | } 26 | 27 | #tiptip_content { 28 | font-size: 12px; 29 | color: #fff; 30 | text-shadow: 0 0 2px #000; 31 | line-height: 130%; 32 | padding: 4px 8px; 33 | border: 1px solid rgba(255,255,255,0.25); 34 | background-color: rgb(25,25,25); 35 | background-color: rgba(25,25,25,0.92); 36 | background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(transparent), to(#000)); 37 | border-radius: 3px; 38 | -webkit-border-radius: 3px; 39 | -moz-border-radius: 3px; 40 | box-shadow: 0 0 3px #555; 41 | -webkit-box-shadow: 0 0 3px #555; 42 | -moz-box-shadow: 0 0 3px #555; 43 | } 44 | 45 | #tiptip_arrow, #tiptip_arrow_inner { 46 | position: absolute; 47 | border-color: transparent; 48 | border-style: solid; 49 | border-width: 6px; 50 | height: 0; 51 | width: 0; 52 | } 53 | 54 | #tiptip_holder.tip_top #tiptip_arrow { 55 | border-top-color: #fff; 56 | border-top-color: rgba(255,255,255,0.35); 57 | } 58 | 59 | #tiptip_holder.tip_bottom #tiptip_arrow { 60 | border-bottom-color: #fff; 61 | border-bottom-color: rgba(255,255,255,0.35); 62 | } 63 | 64 | #tiptip_holder.tip_right #tiptip_arrow { 65 | border-right-color: #fff; 66 | border-right-color: rgba(255,255,255,0.35); 67 | } 68 | 69 | #tiptip_holder.tip_left #tiptip_arrow { 70 | border-left-color: #fff; 71 | border-left-color: rgba(255,255,255,0.35); 72 | } 73 | 74 | #tiptip_holder.tip_top #tiptip_arrow_inner { 75 | margin-top: -7px; 76 | margin-left: -6px; 77 | border-top-color: rgb(25,25,25); 78 | border-top-color: rgba(25,25,25,0.92); 79 | } 80 | 81 | #tiptip_holder.tip_bottom #tiptip_arrow_inner { 82 | margin-top: -5px; 83 | margin-left: -6px; 84 | border-bottom-color: rgb(25,25,25); 85 | border-bottom-color: rgba(25,25,25,0.92); 86 | } 87 | 88 | #tiptip_holder.tip_right #tiptip_arrow_inner { 89 | margin-top: -6px; 90 | margin-left: -5px; 91 | border-right-color: rgb(25,25,25); 92 | border-right-color: rgba(25,25,25,0.92); 93 | } 94 | 95 | #tiptip_holder.tip_left #tiptip_arrow_inner { 96 | margin-top: -6px; 97 | margin-left: -7px; 98 | border-left-color: rgb(25,25,25); 99 | border-left-color: rgba(25,25,25,0.92); 100 | } 101 | 102 | /* Webkit Hacks */ 103 | @media screen and (-webkit-min-device-pixel-ratio:0) { 104 | #tiptip_content { 105 | padding: 4px 8px 5px 8px; 106 | background-color: rgba(45,45,45,0.88); 107 | } 108 | #tiptip_holder.tip_bottom #tiptip_arrow_inner { 109 | border-bottom-color: rgba(45,45,45,0.88); 110 | } 111 | #tiptip_holder.tip_top #tiptip_arrow_inner { 112 | border-top-color: rgba(20,20,20,0.92); 113 | } 114 | } -------------------------------------------------------------------------------- /classes/ppc_notifications_class.php: -------------------------------------------------------------------------------- 1 | current_notification = $notification; 20 | } 21 | 22 | /** 23 | * Adds a simple WordPress pointer to plugin's menu 24 | * 25 | * @access public 26 | * @since 2.46 27 | */ 28 | 29 | function display_notification() { 30 | ?> 31 | 32 |
35 | 36 | 58 | 59 | 4 ) ); 77 | 78 | if ( ! is_wp_error( $feed ) ) { 79 | if ( isset( $feed['body'] ) && strlen( $feed['body'] ) > 0 ) 80 | $notifications = maybe_unserialize( wp_remote_retrieve_body( $feed ) ); 81 | } else { 82 | $notifications = $feed; 83 | //new PPC_Error( "ppc_notifications_get_remote_error", $feed->get_error_message(), $feed->get_error_code() ); //log error 84 | } 85 | 86 | set_transient( 'ppc_notifications_list', $notifications, 3600*15 ); //log even if error to avoid making too many requests 87 | } 88 | 89 | } 90 | 91 | return apply_filters( 'ppc_notifications_get_list', $notifications ); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | cache/ 2 | 3 | ################# 4 | ## Eclipse 5 | ################# 6 | 7 | *.pydevproject 8 | .project 9 | .metadata 10 | bin/ 11 | tmp/ 12 | *.tmp 13 | *.bak 14 | *.swp 15 | *~.nib 16 | local.properties 17 | .classpath 18 | .settings/ 19 | .loadpath 20 | .svn/ 21 | branches/ 22 | 23 | # External tool builders 24 | .externalToolBuilders/ 25 | 26 | # Locally stored "Eclipse launch configurations" 27 | *.launch 28 | 29 | # CDT-specific 30 | .cproject 31 | 32 | # PDT-specific 33 | .buildpath 34 | 35 | 36 | ################# 37 | ## Visual Studio 38 | ################# 39 | 40 | ## Ignore Visual Studio temporary files, build results, and 41 | ## files generated by popular Visual Studio add-ons. 42 | 43 | # User-specific files 44 | *.suo 45 | *.user 46 | *.sln.docstates 47 | 48 | # Build results 49 | 50 | [Dd]ebug/ 51 | [Rr]elease/ 52 | x64/ 53 | build/ 54 | [Bb]in/ 55 | [Oo]bj/ 56 | 57 | # MSTest test Results 58 | [Tt]est[Rr]esult*/ 59 | [Bb]uild[Ll]og.* 60 | 61 | *_i.c 62 | *_p.c 63 | *.ilk 64 | *.meta 65 | *.obj 66 | *.pch 67 | *.pdb 68 | *.pgc 69 | *.pgd 70 | *.rsp 71 | *.sbr 72 | *.tlb 73 | *.tli 74 | *.tlh 75 | *.tmp 76 | *.tmp_proj 77 | *.log 78 | *.vspscc 79 | *.vssscc 80 | .builds 81 | *.pidb 82 | *.log 83 | *.scc 84 | 85 | # Visual C++ cache files 86 | ipch/ 87 | *.aps 88 | *.ncb 89 | *.opensdf 90 | *.sdf 91 | *.cachefile 92 | 93 | # Visual Studio profiler 94 | *.psess 95 | *.vsp 96 | *.vspx 97 | 98 | # Guidance Automation Toolkit 99 | *.gpState 100 | 101 | # ReSharper is a .NET coding add-in 102 | _ReSharper*/ 103 | *.[Rr]e[Ss]harper 104 | 105 | # TeamCity is a build add-in 106 | _TeamCity* 107 | 108 | # DotCover is a Code Coverage Tool 109 | *.dotCover 110 | 111 | # NCrunch 112 | *.ncrunch* 113 | .*crunch*.local.xml 114 | 115 | # Installshield output folder 116 | [Ee]xpress/ 117 | 118 | # DocProject is a documentation generator add-in 119 | DocProject/buildhelp/ 120 | DocProject/Help/*.HxT 121 | DocProject/Help/*.HxC 122 | DocProject/Help/*.hhc 123 | DocProject/Help/*.hhk 124 | DocProject/Help/*.hhp 125 | DocProject/Help/Html2 126 | DocProject/Help/html 127 | 128 | # Click-Once directory 129 | publish/ 130 | 131 | # Publish Web Output 132 | *.Publish.xml 133 | *.pubxml 134 | 135 | # NuGet Packages Directory 136 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 137 | #packages/ 138 | 139 | # Windows Azure Build Output 140 | csx 141 | *.build.csdef 142 | 143 | # Windows Store app package directory 144 | AppPackages/ 145 | 146 | # Others 147 | sql/ 148 | *.Cache 149 | ClientBin/ 150 | [Ss]tyle[Cc]op.* 151 | ~$* 152 | *~ 153 | *.dbmdl 154 | *.[Pp]ublish.xml 155 | *.pfx 156 | *.publishsettings 157 | 158 | # RIA/Silverlight projects 159 | Generated_Code/ 160 | 161 | # Backup & report files from converting an old project file to a newer 162 | # Visual Studio version. Backup files are not needed, because we have git ;-) 163 | _UpgradeReport_Files/ 164 | Backup*/ 165 | UpgradeLog*.XML 166 | UpgradeLog*.htm 167 | 168 | # SQL Server files 169 | App_Data/*.mdf 170 | App_Data/*.ldf 171 | 172 | ############# 173 | ## Windows detritus 174 | ############# 175 | 176 | # Windows image file caches 177 | Thumbs.db 178 | ehthumbs.db 179 | 180 | # Folder config file 181 | Desktop.ini 182 | 183 | # Recycle Bin used on file shares 184 | $RECYCLE.BIN/ 185 | 186 | # Mac crap 187 | .DS_Store 188 | 189 | 190 | ############# 191 | ## Python 192 | ############# 193 | 194 | *.py[co] 195 | 196 | # Packages 197 | *.egg 198 | *.egg-info 199 | dist/ 200 | build/ 201 | eggs/ 202 | parts/ 203 | var/ 204 | sdist/ 205 | develop-eggs/ 206 | .installed.cfg 207 | 208 | # Installer logs 209 | pip-log.txt 210 | 211 | # Unit test / coverage reports 212 | .coverage 213 | .tox 214 | 215 | #Translations 216 | #*.mo 217 | 218 | #Mr Developer 219 | .mr.developer.cfg 220 | banner-772x250.png 221 | -------------------------------------------------------------------------------- /js/ppc_stats_effects.js: -------------------------------------------------------------------------------- 1 | jQuery(document).ready(function($) { 2 | $('#post_pay_counter_time_start').datepicker({ 3 | dateFormat : 'yy-mm-dd', 4 | minDate : ppc_stats_effects_vars.datepicker_mindate, 5 | maxDate: ppc_stats_effects_vars.datepicker_maxdate, 6 | changeMonth : true, 7 | changeYear : true, 8 | showButtonPanel: true, 9 | showOtherMonths: true, 10 | selectOtherMonths: true, 11 | showAnim: "slideDown", 12 | onSelect: function(dateText, inst) { 13 | $('#post_pay_counter_time_end').datepicker('option', 'minDate', new Date(inst.selectedYear, inst.selectedMonth, inst.selectedDay)); 14 | } 15 | }); 16 | $('#post_pay_counter_time_end').datepicker({ 17 | dateFormat : 'yy-mm-dd', 18 | minDate : ppc_stats_effects_vars.datepicker_mindate, 19 | maxDate: ppc_stats_effects_vars.datepicker_maxdate, 20 | changeMonth : true, 21 | changeYear : true, 22 | showButtonPanel: true, 23 | showOtherMonths: true, 24 | selectOtherMonths: true, 25 | showAnim: "slideDown", 26 | onSelect: function(dateText, inst) { 27 | $('#post_pay_counter_time_start').datepicker('option', 'maxDate', new Date(inst.selectedYear, inst.selectedMonth, inst.selectedDay)); 28 | } 29 | }); 30 | 31 | //Handles date picker fields display 32 | $('#ppc-time-range').change(function() { 33 | var selected = $(this).val(); 34 | 35 | if(selected == 'custom') { 36 | $('#ppc-time-range-custom').css('display', 'block'); 37 | } else { 38 | $('#ppc-time-range-custom').css('display', 'none'); 39 | } 40 | 41 | //Tweaks the datepicker fields dates when a choice is made from select menu 42 | if(selected == 'this_month') { 43 | $('#post_pay_counter_time_start').val(ppc_stats_effects_vars.time_start_this_month); 44 | $('#post_pay_counter_time_end').val(ppc_stats_effects_vars.time_end_this_month); 45 | } 46 | if(selected == 'last_month') { 47 | $('#post_pay_counter_time_start').val(ppc_stats_effects_vars.time_start_last_month); 48 | $('#post_pay_counter_time_end').val(ppc_stats_effects_vars.time_end_last_month); 49 | } 50 | if(selected == 'this_week') { 51 | $('#post_pay_counter_time_start').val(ppc_stats_effects_vars.time_start_this_week); 52 | $('#post_pay_counter_time_end').val(ppc_stats_effects_vars.time_end_this_week); 53 | } 54 | if(selected == 'this_year') { 55 | $('#post_pay_counter_time_start').val(ppc_stats_effects_vars.time_start_this_year); 56 | $('#post_pay_counter_time_end').val(ppc_stats_effects_vars.time_end_this_year); 57 | } 58 | if(selected == 'all_time') { 59 | $('#post_pay_counter_time_start').val(ppc_stats_effects_vars.datepicker_mindate); 60 | $('#post_pay_counter_time_end').val(ppc_stats_effects_vars.datepicker_maxdate); 61 | } 62 | 63 | }); 64 | 65 | //Makes sure datepicker fields are displayed if custom is the default choice 66 | $('#ppc-time-range').trigger('change'); 67 | 68 | $('#ppc_stats_role').on('change', function(e) { 69 | e.preventDefault(); 70 | 71 | //$('#ppcp_ga_status_ajax_loader').css('display', 'inline'); 72 | $('#ppc_stats_role').attr('disabled', 'disabled'); 73 | 74 | var data = { 75 | action: "ppc_stats_get_users_by_role", 76 | user_role: $('#ppc_stats_role').val(), 77 | _ajax_nonce: ppc_stats_effects_vars.nonce_ppc_stats_get_users_by_role 78 | }; 79 | 80 | $.post(ajaxurl, data, function(response) { 81 | //$('#ppcp_ga_status_ajax_loader').css('display', 'none'); 82 | $('#ppc_stats_role').removeAttr('disabled'); 83 | 84 | if(! response.success) { 85 | alert(response); 86 | } else { 87 | $('#ppc_stats_user').html(response.data.html); 88 | } 89 | }); 90 | }); 91 | }); 92 | -------------------------------------------------------------------------------- /classes/ppc_visits_trackers.php: -------------------------------------------------------------------------------- 1 | array( 24 | 'post-views-counter' => array( 25 | 'name' => 'Post Views Counter', 26 | 'callback' => 'ppc_get_post_views_counter_views', 27 | ), 28 | 'slimstat-analytics' => array( 29 | 'name' => 'Slimstat Analytics', 30 | 'callback' => 'ppc_wp_get_slimstat_views', 31 | ), 32 | 'wp-postviews' => array( 33 | 'name' => 'WP-PostViews', 34 | 'callback' => 'ppc_get_wp_postviews_views', 35 | ), 36 | 'active-analytics' => array( 37 | 'name' => 'Active Analytics', 38 | 'callback' => 'ppc_get_active_analytics_views', 39 | ), 40 | 'wordpress-popular-posts' => array( 41 | 'name' => 'WordPress Popular Posts', 42 | 'callback' => 'ppc_get_wordpress_popular_posts_views', 43 | ), 44 | 'top-10' => array( 45 | 'name' => 'Top 10', 46 | 'callback' => 'ppc_get_top_10_posts_views', 47 | ), 48 | ), 49 | ) ); 50 | } 51 | 52 | function ppc_wp_get_slimstat_views( $post ) { 53 | global $ppc_wp_slimstat_include_status; 54 | if( ! ( $ppc_wp_slimstat_include_status AND ppc_is_plugin_active( 'wp-slimstat/wp-slimstat.php' ) ) ) 55 | return ppc_default_visits_callback( $post ); 56 | $filters = 'content_id equals ' . $post->ID; 57 | wp_slimstat_db::init( $filters ); 58 | $post_views = wp_slimstat_db::count_records( 'id', '', false ); 59 | return $post_views; 60 | } 61 | 62 | function ppc_get_wp_postviews_views( $post ) { 63 | if( ! ppc_is_plugin_active( 'wp-postviews/wp-postviews.php' ) ) 64 | return ppc_default_visits_callback( $post ); 65 | $post_views = (int) get_post_meta( $post->ID, 'views', true ); 66 | //if( ! $post_views ) 67 | // $post_views = 0; 68 | return $post_views; 69 | } 70 | 71 | function ppc_get_post_views_counter_views( $post ) { 72 | if( ! ppc_is_plugin_active( 'post-views-counter/post-views-counter.php' ) ) 73 | return ppc_default_visits_callback( $post ); 74 | $post_views = pvc_get_post_views( $post->ID ); 75 | return $post_views; 76 | } 77 | 78 | function ppc_get_wordpress_popular_posts_views( $post ) { 79 | if( ! ppc_is_plugin_active( 'wordpress-popular-posts/wordpress-popular-posts.php' ) ) 80 | return ppc_default_visits_callback( $post ); 81 | $post_views = wpp_get_views( $post->ID, 'all', false ); 82 | return $post_views; 83 | } 84 | 85 | function ppc_get_active_analytics_views( $post ) { 86 | if( ! ppc_is_plugin_active( 'active-analytics/active-analytics.php' ) ) 87 | return ppc_default_visits_callback( $post ); 88 | $postmeta_name = get_option( 'wpaa_pageviews_key' ); 89 | $post_views = (int) get_post_meta( $post->ID, $postmeta_name, true ); 90 | return $post_views; 91 | } 92 | 93 | function ppc_get_top_10_posts_views( $post ) { 94 | if( ! ppc_is_plugin_active( 'top-10/top-10.php' ) ) 95 | return ppc_default_visits_callback( $post ); 96 | $post_views = (int) get_tptn_post_count_only( $post->ID ); 97 | return $post_views; 98 | } 99 | 100 | function ppc_default_visits_callback( $post ) { 101 | return -1; 102 | } 103 | -------------------------------------------------------------------------------- /style/ui-lightness/jquery.ui.datepicker.css: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery UI Datepicker 1.8.15 3 | * 4 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 5 | * Dual licensed under the MIT or GPL Version 2 licenses. 6 | * http://jquery.org/license 7 | * 8 | * http://docs.jquery.com/UI/Datepicker#theming 9 | */ 10 | .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } 11 | .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } 12 | .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } 13 | .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } 14 | .ui-datepicker .ui-datepicker-prev { left:2px; } 15 | .ui-datepicker .ui-datepicker-next { right:2px; } 16 | .ui-datepicker .ui-datepicker-prev-hover { left:1px; } 17 | .ui-datepicker .ui-datepicker-next-hover { right:1px; } 18 | .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } 19 | .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } 20 | .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } 21 | .ui-datepicker select.ui-datepicker-month-year {width: 100%;} 22 | .ui-datepicker select.ui-datepicker-month, 23 | .ui-datepicker select.ui-datepicker-year { width: 49%;} 24 | .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } 25 | .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } 26 | .ui-datepicker td { border: 0; padding: 1px; } 27 | .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } 28 | .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } 29 | .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } 30 | .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } 31 | 32 | /* with multiple calendars */ 33 | .ui-datepicker.ui-datepicker-multi { width:auto; } 34 | .ui-datepicker-multi .ui-datepicker-group { float:left; } 35 | .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } 36 | .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } 37 | .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } 38 | .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } 39 | .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } 40 | .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } 41 | .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } 42 | .ui-datepicker-row-break { clear:both; width:100%; font-size:0em; } 43 | 44 | /* RTL support */ 45 | .ui-datepicker-rtl { direction: rtl; } 46 | .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } 47 | .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } 48 | .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } 49 | .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } 50 | .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } 51 | .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } 52 | .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } 53 | .ui-datepicker-rtl .ui-datepicker-group { float:right; } 54 | .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } 55 | .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } 56 | 57 | /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ 58 | .ui-datepicker-cover { 59 | display: none; /*sorry for IE5*/ 60 | display/**/: block; /*sorry for IE5*/ 61 | position: absolute; /*must have*/ 62 | z-index: -1; /*must have*/ 63 | filter: mask(); /*must have*/ 64 | top: -4px; /*must have*/ 65 | left: -4px; /*must have*/ 66 | width: 200px; /*must have*/ 67 | height: 200px; /*must have*/ 68 | } -------------------------------------------------------------------------------- /classes/ppc_error_class.php: -------------------------------------------------------------------------------- 1 | $code, 36 | 'message' => $message, 37 | 'data' => $data, 38 | 'time' => current_time( 'timestamp' ) 39 | ); 40 | 41 | //If debug or logging enabled, make up detailed error (only shown if requested) 42 | if( PPC_DEBUG_SHOW OR ( PPC_DEBUG_LOG AND $log ) ) 43 | $error_details['debug_message'] = 'An error was thrown with code "'.$code.'", message "'.$message.'" and debug data "'.var_export( $data, true ).'".'; 44 | 45 | if( PPC_DEBUG_SHOW ) 46 | $error_details['output'] = $error_details['debug_message']; 47 | else 48 | $error_details['output'] = $error_details['message']; 49 | 50 | //If logging enabled, push error with others 51 | if( PPC_DEBUG_LOG AND $log ) { 52 | $errors = @file_get_contents( $ppc_global_settings['file_errors'] ); 53 | 54 | if( $errors !== false ) 55 | $errors = unserialize( $errors ); 56 | else 57 | $errors = array(); 58 | 59 | $errors[] = $error_details; 60 | 61 | //Get rid of old errors - only run once a day, ensure this through an option 62 | $daily_delete = get_option( $ppc_global_settings['option_error_deletion'], true ); 63 | if( $daily_delete != false AND $daily_delete < current_time( 'timestamp' ) - 86400 ) { 64 | foreach( $errors as $key => $single ) { 65 | if( $single['time'] < ( current_time( 'timestamp' ) - PPC_ERROR_PURGE_TIME*24*60*60 ) ) 66 | unset( $errors[$key] ); 67 | } 68 | 69 | //See the record is not bigger than ~10MB 70 | if( strlen( serialize( $errors ) ) > 10000 ) 71 | $errors = array( $error_details ); //only save latest error 72 | 73 | update_option( $ppc_global_settings['option_error_deletion'], current_time( 'timestamp' ) ); 74 | } 75 | 76 | if( file_put_contents( $ppc_global_settings['file_errors'], serialize( $errors ) ) ) 77 | $this->wp_error = new WP_Error( 'ppc_update_error_update', 'Could not update errors option.', 'post-pay-counter' ); 78 | } 79 | 80 | $this->wp_error = new WP_Error( $error_details['code'], $error_details['output'], $data ); 81 | } 82 | 83 | /** 84 | * Returns the error stored in the class var. 85 | * 86 | * @since 2.21 87 | * @access public 88 | * 89 | * @return object WP_Error with current error details 90 | */ 91 | function return_error() { 92 | return $this->wp_error; 93 | } 94 | 95 | /** 96 | * Retrieves an error from the error log, if found. 97 | * Several searching criteria available. 98 | * 99 | * @since 2.604 100 | * @access public 101 | * 102 | * @param $args array 103 | * @return array|bool the error details, or bool false if not found 104 | */ 105 | static function get_error( $args ) { 106 | global $ppc_global_settings; 107 | 108 | if( isset( $args['error_code'] ) AND ! empty( $args['error_code'] ) ) { 109 | $errors = file_get_contents( $ppc_global_settings['file_errors'] ); 110 | 111 | if( $errors !== false ) 112 | $errors = unserialize( $errors ); 113 | else 114 | return false; 115 | 116 | $key = array_search( $args['error_code'], array_column( $errors, 'code' ) ); 117 | 118 | if( is_int( $key ) ) 119 | return $errors[$key]; 120 | } 121 | 122 | return false; 123 | 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /wp-cli.php: -------------------------------------------------------------------------------- 1 | ] 11 | * : Time range start date in YYYY-MM-DD format. 12 | * 13 | * [--time-end=' . __( 'There was an error retrieving the extensions list from the server. Please try again later.', 'post-pay-counter' ) . '
| '.ucfirst( $counting_type_localized ).' | '; 63 | $html .= ''.__( 'Payment' , 'post-pay-counter').' | '; 64 | $html .= '
|---|---|
| '; 73 | $html .= ' | '; 74 | $html .= ' |
';
109 | $html .= '';
110 | $html .= '
';
111 | $html .= '';
112 | $html .= __( 'Payment display status', 'post-pay-counter' );
113 | $html .= '';
120 |
121 | return $html;
122 | }
123 |
124 | /**
125 | * Checks whether the given value is set or not. Sets $checkbox to NULL so we'll later know what vars are still to be dealt with
126 | *
127 | * @access public
128 | * @since 2.0
129 | * @param $checkbox int checkbox value
130 | * @return bool checkbox status
131 | */
132 |
133 | static function get_checkbox_value( &$checkbox ) {
134 | if( ! isset( $checkbox ) )
135 | return 0;
136 | else
137 | return 1;
138 |
139 | $checkbox = NULL;
140 | }
141 |
142 | /**
143 | * Gets a radio-set value. All three possibilities are set to zero in an array. Switch through the $radio and check which one was selected. The selected option has its value turned to 1 in the return array, while others are still 0. Set $radio to NULL so we'll later know what vars are still to be dealt with.
144 | *
145 | * @access public
146 | * @since 2.0
147 | * @param $radio string the value of the checked radio
148 | * @param $opt_1 string the value of the first option
149 | * @param $opt_2 string the value of the second option
150 | * @param $opt_3 string optional the value of the third option
151 | * @param $options_array array optional allows to handle N options
152 | * @return array the 2/3 possibilities along with their set values
153 | */
154 |
155 | static function get_radio_value( &$radio, $opt_1, $opt_2, $opt_3 = FALSE, $options_array = FALSE ) {
156 |
157 | //New method: handles more than 3 options
158 | if( $options_array !== false ) {
159 | $return = array();
160 |
161 | foreach( $options_array as $single ) {
162 | if( $radio == $single )
163 | $return[$single] = 1;
164 | else
165 | $return[$single] = 0;
166 | }
167 |
168 | //$radio = null; // commented cause visits method are split among free and pro
169 | return $return;
170 | }
171 |
172 | //OLD STUFF for backwards compatibility
173 | $return = array(
174 | $opt_1 => 0,
175 | $opt_2 => 0,
176 | );
177 |
178 | if( $opt_3 )
179 | $return[$opt_3] = 0;
180 |
181 | switch( $radio ) {
182 | case $opt_1:
183 | $return[$opt_1] = 1;
184 | break;
185 |
186 | case $opt_2:
187 | $return[$opt_2] = 1;
188 | break;
189 |
190 | case $opt_3:
191 | $return[$opt_3] = 1;
192 | break;
193 | }
194 |
195 | //$radio = null; // commented cause visits method are split among free and pro
196 | return $return;
197 | }
198 | }
199 |
--------------------------------------------------------------------------------
/classes/ppc_install_functions_class.php:
--------------------------------------------------------------------------------
1 | get_col( "SELECT blog_id FROM ".$wpdb->blogs );
26 |
27 | foreach( $blog_ids as $blog_id ) {
28 | switch_to_blog( $blog_id );
29 | self::ppc_install_procedure();
30 | }
31 |
32 | restore_current_blog();
33 | return;
34 | }
35 |
36 | //Single blog activation
37 | self::ppc_install_procedure();
38 |
39 | //Send to Welcome page
40 | //set_transient( $ppc_global_settings['transient_activation_redirect'], 'do it!', 3600 );
41 | wp_safe_redirect( admin_url( add_query_arg( array( 'page' => 'ppc-about' ), 'admin.php' ) ) );
42 | }
43 |
44 | /**
45 | * If plugin was activated with a network-wide activation, activate and install it on new blogs when they are created
46 | *
47 | * @access public
48 | * @since 2.0
49 | * @param $blog_id int the id of the newly created blog
50 | * @param $user_id int the id of the newly created blog's admin
51 | * @param $domain string the domain of the newly created blog's admin
52 | * @param $path string the path of the newly created blog's admin
53 | * @param $site_id int the site id (usually = 1)
54 | * @param $meta array initial site options
55 | */
56 | static function ppc_new_blog_install( $blog_id, $user_id, $domain, $path, $site_id, $meta ) {
57 | global $ppc_global_settings;
58 |
59 | if( is_plugin_active_for_network( basename( dirname( dirname( __FILE__ ) ).'/post-pay-counter.php' ) ) ) {
60 | switch_to_blog( $blog_id );
61 | self::ppc_install_procedure();
62 | restore_current_blog();
63 |
64 | //Send to Welcome page
65 | //set_transient( $ppc_global_settings['transient_activation_redirect'], 'do it!', 3600 );
66 | wp_safe_redirect( admin_url( add_query_arg( array( 'page' => 'ppc-about' ), 'admin.php' ) ) );
67 | }
68 | }
69 |
70 | /**
71 | * Adds default settings, current version to the database and assigns default capabilities.
72 | *
73 | * @access public
74 | * @since 2.0
75 | */
76 | static function ppc_install_procedure() {
77 | global $ppc_global_settings, $current_user;
78 |
79 | if( ! is_object( $current_user ) )
80 | get_currentuserinfo();
81 |
82 | $default_settings = array(
83 | 'general' => array(
84 | 'userid' => 'general',
85 | 'basic_payment' => 1,
86 | 'basic_payment_value' => 1.5,
87 | 'basic_payment_display_status' => 'tooltip',
88 | 'counting_words' => 1,
89 | 'counting_words_system_zonal' => 0,
90 | 'counting_words_system_zonal_value' => array(
91 | 0 => array(
92 | 'threshold' => 100,
93 | 'payment' => 1
94 | ),
95 | 1 => array(
96 | 'threshold' => 200,
97 | 'payment' => 2
98 | )
99 | ),
100 | 'counting_words_system_incremental' => 1,
101 | 'counting_words_system_incremental_value' => 0.01,
102 | 'counting_words_threshold_max' => 0,
103 | 'counting_words_display_status' => 'count',
104 | 'counting_words_legacy' => 0,
105 | 'counting_words_parse_spaces' => 0,
106 | 'counting_words_include_excerpt' => 0,
107 | 'counting_words_exclude_pre' => 0,
108 | 'counting_words_exclude_captions' => 0,
109 | 'counting_words_apply_shortcodes' => 0,
110 | 'counting_words_global_threshold' => 0,
111 | 'counting_visits' => 0,
112 | 'counting_visits_callback' => 0,
113 | 'counting_visits_callback_value' => '',
114 | 'counting_visits_ppc_supported_tracker' => 1,
115 | 'counting_visits_tracker' => '',
116 | 'counting_visits_system_zonal' => 0,
117 | 'counting_visits_system_zonal_value' => array(
118 | 0 => array(
119 | 'threshold' => 100,
120 | 'payment' => 1
121 | ),
122 | 1 => array(
123 | 'threshold' => 200,
124 | 'payment' => 2
125 | )
126 | ),
127 | 'counting_visits_system_incremental' => 1,
128 | 'counting_visits_system_incremental_value' => 0.01,
129 | 'counting_visits_threshold_max' => 0,
130 | 'counting_visits_global_threshold' => 0,
131 | 'counting_visits_display_percentage' => 100,
132 | 'counting_visits_display_status' => 'count',
133 | 'counting_images' => 1,
134 | 'counting_images_system_zonal' => 0,
135 | 'counting_images_system_zonal_value' => array(
136 | 0 => array(
137 | 'threshold' => 100,
138 | 'payment' => 1
139 | ),
140 | 1 => array(
141 | 'threshold' => 200,
142 | 'payment' => 2
143 | )
144 | ),
145 | 'counting_images_system_incremental' => 1,
146 | 'counting_images_system_incremental_value' => 0.2,
147 | 'counting_images_threshold_min' => 2,
148 | 'counting_images_threshold_max' => 10,
149 | 'counting_images_include_featured' => 1,
150 | 'counting_images_include_galleries' => 1,
151 | 'counting_images_global_threshold' => 0,
152 | 'counting_images_display_status' => 'count',
153 | 'counting_comments' => 1,
154 | 'counting_comments_system_zonal' => 0,
155 | 'counting_comments_system_zonal_value' => array(
156 | 0 => array(
157 | 'threshold' => 100,
158 | 'payment' => 1
159 | ),
160 | 1 => array(
161 | 'threshold' => 200,
162 | 'payment' => 2
163 | )
164 | ),
165 | 'counting_comments_system_incremental' => 1,
166 | 'counting_comments_system_incremental_value' => 0.2,
167 | 'counting_comments_threshold_min' => 2,
168 | 'counting_comments_threshold_max' => 10,
169 | 'counting_comments_global_threshold' => 0,
170 | 'counting_comments_display_status' => 'count',
171 | 'counting_payment_total_threshold' => 0,
172 | 'counting_payment_only_when_total_threshold' => 0,
173 | 'counting_allowed_post_statuses' => array(
174 | 'publish' => 1,
175 | 'future' => 1,
176 | 'pending' => 0,
177 | 'private' => 0
178 | ),
179 | 'counting_exclude_quotations' => 1,
180 | 'can_see_others_general_stats' => 1,
181 | 'can_see_others_detailed_stats' => 1,
182 | 'can_see_countings_special_settings' => 1,
183 | 'enable_post_stats_caching' => 1,
184 | 'display_overall_stats' => 1,
185 | 'can_see_options_user_roles' => array(
186 | 'administrator' => 'administrator'
187 | ),
188 | 'can_see_stats_user_roles' => array(
189 | 'administrator' => 'administrator',
190 | 'editor' => 'editor',
191 | 'author' => 'author',
192 | 'contributor' => 'contributor'
193 | ),
194 | 'counting_allowed_user_roles' => array(
195 | 'administrator' => 'administrator',
196 | 'editor' => 'editor',
197 | 'author' => 'author',
198 | 'contributor' => 'contributor'
199 | ),
200 | 'counting_allowed_post_types' => array(
201 | 'post',
202 | 'page'
203 | ),
204 | 'default_stats_time_range_month' => 1,
205 | 'default_stats_time_range_last_month' => 0,
206 | 'default_stats_time_range_this_year' => 0,
207 | 'default_stats_time_range_week' => 0,
208 | 'default_stats_time_range_all_time' => 0,
209 | 'default_stats_time_range_custom' => 0,
210 | 'default_stats_time_range_custom_value' => 100,
211 | 'default_stats_time_range_start_day' => 0,
212 | 'default_stats_time_range_start_day_value' => '1605-11-05',
213 | 'admins_override_permissions' => 1,
214 | 'stats_display_edit_post_link' => 0,
215 | 'enable_stats_payments_tooltips' => 1,
216 | 'payment_display_round_digits' => 2,
217 | 'save_stats_order' => 1,
218 | 'hide_column_total_payment' => 0,
219 | 'stats_show_all_users' => 0,
220 | )
221 | );
222 |
223 | //Only add default settings if not there already
224 | $general_settings = PPC_general_functions::get_settings( 'general' );
225 | if( ! is_array( $general_settings ) ) {
226 |
227 | //Add option if not available, update it otherwise
228 | if( get_option( $ppc_global_settings['option_name'] ) === false ) {
229 | if( ! add_option( $ppc_global_settings['option_name'], $default_settings['general'], '', 'no' ) ) {
230 | $error = new PPC_Error( 'ppc_add_option_general_error', __( 'Could not add general settings option.', 'post-pay-counter' ), array(
231 | 'option_name' => $ppc_global_settings['option_name'],
232 | 'old_settings' => $general_settings,
233 | 'default_settings' => $default_settings['general']
234 | ) );
235 | trigger_error( $wp_error->get_error_message(), E_USER_ERROR );
236 | }
237 | } else {
238 | if( ! update_option( $ppc_global_settings['option_name'], $default_settings['general'] ) ) {
239 | $error = new PPC_Error( 'ppc_update_option_general_error', __( 'Could not update general settings option.', 'post-pay-counter' ), array(
240 | 'option_name' => $ppc_global_settings['option_name'],
241 | 'old_settings' => $general_settings,
242 | 'default_settings' => $default_settings['general']
243 | ) );
244 | trigger_error( $wp_error->get_error_message(), E_USER_ERROR );
245 | }
246 | }
247 | }
248 |
249 | //Add error log option
250 | if( ! get_option( $ppc_global_settings['option_errors'] ) )
251 | add_option( $ppc_global_settings['option_errors'], $errors, '', 'no' );
252 |
253 | //Add dismissed notification option
254 | $dismissed = array(
255 | "ppcp_publisher_bonus_available",
256 | "ppcp_facebook_available",
257 | "ppcp_stopwords_available"
258 | );
259 | if( ! get_option( "ppc_dismissed_notifications" ) )
260 | add_option( "ppc_dismissed_notifications", $dismissed, '', 'no' );
261 |
262 | //Set default permissions for acessing plugin pages
263 | PPC_general_functions::manage_cap_allowed_user_roles_plugin_pages( $default_settings['general']['can_see_options_user_roles'], $default_settings['general']['can_see_stats_user_roles'] );
264 |
265 | //Insert default addons list
266 | PPC_addons::add_addons_list();
267 |
268 | update_option( 'ppc_current_version', $ppc_global_settings['newest_version'] );
269 | }
270 | }
271 |
--------------------------------------------------------------------------------
/classes/ppc_ajax_functions_class.php:
--------------------------------------------------------------------------------
1 | get_error_message() );
44 |
45 | die( 'ok' );
46 | }
47 |
48 | /**
49 | * Handles the AJAX request for the misc settings saving.
50 | *
51 | * @access public
52 | * @since 2.0
53 | * @param $nonce string the WP nonce
54 | */
55 |
56 | static function save_misc_settings() {
57 | self::ppc_check_ajax_referer( 'ppc_save_misc_settings' );
58 |
59 | parse_str( $_REQUEST['form_data'], $settings );
60 |
61 | $save_settings = PPC_save_options::save_misc_settings( $settings );
62 | if( is_wp_error( $save_settings ) ) die( $save_settings->get_error_message() );
63 |
64 | die( 'ok' );
65 | }
66 |
67 | /**
68 | * Handles the AJAX request for the permissions saving.
69 | *
70 | * @access public
71 | * @since 2.0
72 | * @param $nonce string the WP nonce
73 | */
74 |
75 | static function save_permissions() {
76 | self::ppc_check_ajax_referer( 'ppc_save_permissions' );
77 |
78 | parse_str( $_REQUEST['form_data'], $settings );
79 |
80 | $save_settings = PPC_save_options::save_permissions( $settings );
81 | if( is_wp_error( $save_settings ) ) die( $save_settings->get_error_message() );
82 |
83 | die( 'ok' );
84 | }
85 |
86 | /**
87 | * Fetches users to be personalized basing on the requested user role.
88 | *
89 | * @access public
90 | * @since 2.0
91 | */
92 | static function personalize_fetch_users_by_roles() {
93 | global $ppc_global_settings;
94 | self::ppc_check_ajax_referer( 'ppc_personalize_fetch_users_by_roles' );
95 |
96 | echo 'ok';
97 | $user_role = trim( $_REQUEST['user_role'] );
98 |
99 | $args = array(
100 | 'orderby' => 'display_name',
101 | 'order' => 'ASC',
102 | 'role' => $user_role,
103 | 'count_total' => true,
104 | 'fields' => array(
105 | 'ID',
106 | 'display_name'
107 | )
108 | );
109 |
110 | /**
111 | * Filters user fetching (by role) for Personalize settings box.
112 | *
113 | * This fetches the users list that is shown in the Options Personalize settings box when a user role is clicked.
114 | *
115 | * @since 2.0
116 | * @param array $args WP_User_query args
117 | */
118 |
119 | $args = apply_filters( 'ppc_personalize_fetch_users_args', $args );
120 |
121 | $users_to_show = new WP_User_Query( $args );
122 |
123 | if( $users_to_show->get_total() == 0 ) {
124 | _e( 'No users found.' , 'post-pay-counter');
125 |
126 | } else {
127 | $n = 0;
128 | $html = '';
129 | echo '
| '.$single->display_name.' | '; 136 | 137 | if( $n % 3 == 2 ) 138 | $html .= '
108 |
109 |
110 |
111 |
112 |
113 | 100 words are worth $1.00) or a zonal one (e.g. between 100 and 200 words pay $1.20 => 190 words are worth $1.20) with as many zones you want.', 'post-pay-counter' );?>
114 | 115 | 116 | 117 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 | \\1', $readme );
250 | $readme = preg_replace( '/[\040]\*\*(.*?)\*\*/', ' \\1', $readme );
251 | $readme = preg_replace( '/[\040]\*(.*?)\*/', ' \\1', $readme );
252 | $readme = preg_replace( '/= (.*?) =/', '