jaywood / content-warning-v3 Goto Github PK
View Code? Open in Web Editor NEWA WordPress Plugin to warn your users of possibly offensive content.
License: GNU General Public License v2.0
A WordPress Plugin to warn your users of possibly offensive content.
License: GNU General Public License v2.0
Good Day Sir,
I have been using your plugin now for some time on two separate websites with much success. The plugin has been wonderful. Recently I have been experiencing an issue with some but not all of my members. When they select "enter' the warning will disappear but reappear every page change. The users discussing this with me this evening are 2 Safari users and 1 Chrome user. The Chrome user selected F5 and said that it did resolve his issue. I am experiencing this issue on both websites.
www.littlekaninchen.com
www.husdom.com
I have deactivated the plugin twice with no positive results.
I currently have the plugin deactivated for both of these sites but would be happy to activate them if you need to see the issue. I like this plugin very much and would like to know when it is working properly.
I should also mention that I have recently changed servers and have been experiencing other issues site wide so I am not 100% positive that this is an issue with the plugin as it may be with my server or settings.
Best wishes,
Mr Fox
Hello there,
Firstly, I apologize for my English.
I use WP 3.9.1
I installed the plugin (version 3.5.3), but can not click the buttons (enter or exit)
thank you
http://www.hortus44.com
Installed the latest plugin from wordpress.org, and changed the custom css as follows:
#cwv3_exit { background-color: #777777; }
#cwv3_enter { background-color: #007777; }
The dialog still shows the normal red and green colours for the buttons, and on viewing the source it doesn't look like the custom CSS gets output anywhere. Running WP 3.9.2.
Hi, is it possible to save no cookie for the Exit button so that people will get asked again next time they visit the site?
Hello,
I would like to use the confirm message appears every user surfing a category, so I set the cookies "0" value but the plugin does not work.
It still remembers the cookies.
The content warning popup correctly on restricted category, but once i agree on the popup and navigate inside the post category, I have the popup on each page.
I have that on each browser
I have wordpress 4.0
Content Warning v2 Version 3.6.2
I tried to add a background image in Content-Warning admin, but it still showed the color and opacity. So I added to the custom css section to overwrite the .cwv3.dialog-overlay tag.
The image now shows up now, however it gets repeated and I want the background image to go full screen, centered and no repeat but it's still getting the tiling of the background image. Not sure what to do.
Website is http://www.kikoriwhiskey.com
This is the custom css I added to try to change the background image in the Custom CSS admin section:
.cwv3.dialog-overlay{
background-image: url("http://www.kikoriwhiskey.com/wp-content/uploads/2015/08/MG_9118Kikori.jpg");
/* Set rules to fill background */
min-height: 100%;
min-width: 1024px;
/* Set up proportionate scaling */
width: 100%;
height: auto;
/* Set up positioning */
position: fixed;
top: 0;
left: 0;
}
Am I doing something wrong?
Hi,
First of all thank you for the plugin, it's great. I have one issue with it though. It works fine in my site, I use it only for the home page, however, after pressing enter once the popup won't show up again unless i clear my cookies. I thought if I'd enter 0 in the cookie life field it would create a cookie just for the browsing session, however in that case it doesn't create a cookie at all and the pop up just pops after each click. I saw in your video that it's possible that the pop up will show in every time you enter a page, that's what I'd like.
I'm using the latest version: 3.6.4.
Thank you very much!
Hello,
Please add WPML support for multi languages.
http://tokyo-escort-massage.com/
It does not display warning on PC.
Please tell me why....
Appreciate your time.
I've got the plugin set for 5 days on the cookies, but it still brings up the warning every time you visit the site as well as whenever you hit the "home" button while on the site (www.striplandia.com). I have verified cookies are beings saved while using in FF 32.0.2.
Let me know if there is any further information I can provide. Thanks!
Hi! First of all, this plugin is great, my only problem is, that it does not matter what kind of picture I tried to upload, none of them was shown by the plugin via entering the site. All other parts are ok, just the background image is not working for me. Please help to solve this issue.
Thanks in advance!
Br,
cs
JW_SIMPLE_OPTIONS function jop_checked
throws error on unchecked categories. Error notice:
Notice: Array to string conversion in ../wp-includes/general-template.php on line 3550
You need to stringify $haystack, if match is not met. My quick solution
function jop_checked( $haystack, $cur, $show = FALSE ) {
if ( is_array( $haystack ) && in_array( $cur, $haystack ) ) {
$cur = $haystack = 1;
}
if(is_array($haystack)) { //if $haystack is still an array, take first value
$haystack = array_shift($haystack);
}
return checked( $haystack, $cur, $show );
}
Is there any shortcode I can use in my php file to show created popup? I wish to show age restriction only for some pages (custom taxonomy file),
Hi. I setup your plugin on http://alphamaleflex.com/
It is enabled and the entire site button clicked but no dialog is displayed.
Not really sure where to go next to look for what could be causing that?
Thanks for your help.
Per forum request here, when a user clicks exit, on a default install, he/she is immediately redirected to google, even if Denial Handling
is disabled.
Confirmed this is an issue on WordPress 4.3, will fix of course.
Apparently jQuery Cookie ( current library ) has been deprecated in favor of a non-jQuery based library.
JW Simple Options is overkill, and isn't flexible. Need to move all the settings over to the settings API instead.
Seems to be same as old css errors. No custom css is working at all on v3.6.9
Cookies are not checked or stored in a way that works with URL re-writing. An example where this is problematic would be if the entire website is set to use WordPress but WordPress is installed in a separate directory. This would be setup under "General Settings" and can usually be identified when the "WordPress Address (URL)" setting is different from the "Site Address (URL)" setting.
For example:
WordPress Address (URL) = http://www.somewebsite.com/wordpress/
Site Address (URL) = http://www.somewebsite.com
In this case, the cookie would be set to the site address but only with a path of "/wordpress/". When the user visits the main website, the URL is rewritten before the plugin is loaded, After the URL is re-written, the site loads and the plugin then checks for a cookie that has a path of "/" that it will not find.
I will make recommendations for corrections in future comments.
Hi. I’ve installed the plugin on my website (WP theme with customised settings). Although It works on pages and posts it doesn't on portfolios. There is any workaround for that?
If I use custom post types than option doesn't appear in admin view, so I can not put restriction for one custom post.
Hi. Our current theme uses a custom post type called "projects". Your plugin works great on standard posts and pages but doesn't see the project post type to protect those posts. I noticed that in your dev documentation area you gave a hook for adding this support. I am new to adding hooks/filters to wordpress. Could you please give me an idea to where i should add this code to get this custom post type protected. Thanks for all for help
i mark page to display the warning but when i uncheck in the page the checkbox and update the page is still reaming check
I'm getting some Notices + Warning after a fresh install of your plugin. I'm trying to write a child theme so I'm paying more attention to the debug.log than normal. That being said, I had to do some patching on your lib/jw_simeple_options/simple_options sub module before I could even render your CWv3 Options page.
simple_options.php was fixed by commenting out the function JW_SIMPLE_OPTIONS, using ob_start/$output = ob_get_contents in function buildCheckFields. isset($this->menu_pos) ? $this->menu_pos : 0 in function load_admin_menu [default], and isset($data['def'])? $data['def'] : '' in function render_option_field [case 'check']...
After all that, the CWv3 Options page seems to render correctly.
But now I'm seeing some stuff in the debug.log which I think could be cleared with some isset() checks in your main.class.php. It seems in your function set_cookie, you json_decode $_COOKIE[{index}] before you're setting it.
This clears the index errors in line 170-172:
$cData = array(
'pages' => !isset($_COOKIE['cwv3_pages']) ? '' : json_decode( stripslashes( $_COOKIE['cwv3_pages'] ) ),
'posts' => !isset($_COOKIE['cwv3_posts']) ? '' : json_decode( stripslashes( $_COOKIE['cwv3_posts'] ) ),
'categories' => !isset($_COOKIE['cwv3_cats']) ? '' : json_decode( stripslashes( $_COOKIE['cwv3_cats'] ) )
);
Then I get a new error:
[03-Sep-2014 05:31:16 UTC] PHP Warning: Creating default object from empty value in /Applications/MAMP/htdocs/qb/wordpress/wp-content/plugins/content-warning-v2/class/main.class.php on line 177
Which can be resolved with:
foreach ($cData as $key => $value) {
if(is_scalar($value)){
$cData[$key] = new stdClass;
}
}
The same isset check should be done for the $cData in check_data() as well.
Hope this helps a future release. I haven't fully tested your plug-in yet so I'm not sure the impact these changes have made. Below are just logs before messing with main.class.php.
OSX: 10.9.4
MAMP: 3.0.4 / PHP 5.5.10
Chrome: 37.0.2062.94
Firefox 31.0
Safari 7.0.6
WordPress: 3.9.2
Content Warning v2: 3.5.3
Output in Debug Bar: Notices / Warning
Logged in as Admin, Chrome 37, Cache Cleared, Immediate on Enter
NOTICE: wp-content/plugins/content-warning-v2/class/main.class.php:220 - Undefined index: cwv3_posts
require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/stargazer-child/content/page_events_with_intro.php'), get_footer, locate_template, load_template, require_once('/themes/stargazer-child/footer.php'), wp_footer, do_action('wp_footer'), call_user_func_array, CWV3->renderDialog, CWV3->check_data
NOTICE: wp-content/plugins/content-warning-v2/class/main.class.php:221 - Undefined index: cwv3_cats
require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/stargazer-child/content/page_events_with_intro.php'), get_footer, locate_template, load_template, require_once('/themes/stargazer-child/footer.php'), wp_footer, do_action('wp_footer'), call_user_func_array, CWV3->renderDialog, CWV3->check_data
Output in debug.log
Logged out, Chrome 37, Cache Cleared, Immediate on Enter
[03-Sep-2014 04:20:31 UTC] PHP Notice: Undefined index: cwv3_pages in /Applications/MAMP/htdocs/qb/wordpress/wp-content/plugins/content-warning-v2/class/main.class.php on line 170
[03-Sep-2014 04:20:31 UTC] PHP Notice: Undefined index: cwv3_posts in /Applications/MAMP/htdocs/qb/wordpress/wp-content/plugins/content-warning-v2/class/main.class.php on line 171
[03-Sep-2014 04:20:31 UTC] PHP Notice: Undefined index: cwv3_cats in /Applications/MAMP/htdocs/qb/wordpress/wp-content/plugins/content-warning-v2/class/main.class.php on line 172
[03-Sep-2014 04:20:31 UTC] PHP Warning: Creating default object from empty value in /Applications/MAMP/htdocs/qb/wordpress/wp-content/plugins/content-warning-v2/class/main.class.php on line 176
Firefox 31.0
[03-Sep-2014 04:29:25 UTC] PHP Notice: Undefined index: cwv3_pages in /Applications/MAMP/htdocs/qb/wordpress/wp-content/plugins/content-warning-v2/class/main.class.php on line 170
[03-Sep-2014 04:29:25 UTC] PHP Notice: Undefined index: cwv3_posts in /Applications/MAMP/htdocs/qb/wordpress/wp-content/plugins/content-warning-v2/class/main.class.php on line 171
[03-Sep-2014 04:29:25 UTC] PHP Notice: Undefined index: cwv3_cats in /Applications/MAMP/htdocs/qb/wordpress/wp-content/plugins/content-warning-v2/class/main.class.php on line 172
[03-Sep-2014 04:29:25 UTC] PHP Warning: Creating default object from empty value in /Applications/MAMP/htdocs/qb/wordpress/wp-content/plugins/content-warning-v2/class/main.class.php on line 176
Safari 7.0.6
[03-Sep-2014 04:33:18 UTC] PHP Notice: Undefined index: cwv3_pages in /Applications/MAMP/htdocs/qb/wordpress/wp-content/plugins/content-warning-v2/class/main.class.php on line 170
[03-Sep-2014 04:33:18 UTC] PHP Notice: Undefined index: cwv3_posts in /Applications/MAMP/htdocs/qb/wordpress/wp-content/plugins/content-warning-v2/class/main.class.php on line 171
[03-Sep-2014 04:33:18 UTC] PHP Notice: Undefined index: cwv3_cats in /Applications/MAMP/htdocs/qb/wordpress/wp-content/plugins/content-warning-v2/class/main.class.php on line 172
[03-Sep-2014 04:33:18 UTC] PHP Warning: Creating default object from empty value in /Applications/MAMP/htdocs/qb/wordpress/wp-content/plugins/content-warning-v2/class/main.class.php on line 176
[03-Sep-2014 03:58:29 UTC] PHP Notice: Undefined index: cwv3_pages in /Applications/MAMP/htdocs/qb/wordpress/wp-content/plugins/content-warning-v2/class/main.class.php on line 170
[03-Sep-2014 03:58:29 UTC] PHP Notice: Undefined index: cwv3_posts in /Applications/MAMP/htdocs/qb/wordpress/wp-content/plugins/content-warning-v2/class/main.class.php on line 171
[03-Sep-2014 03:58:29 UTC] PHP Notice: Undefined index: cwv3_cats in /Applications/MAMP/htdocs/qb/wordpress/wp-content/plugins/content-warning-v2/class/main.class.php on line 172
[03-Sep-2014 03:58:29 UTC] PHP Warning: Creating default object from empty value in /Applications/MAMP/htdocs/qb/wordpress/wp-content/plugins/content-warning-v2/class/main.class.php on line 176
[03-Sep-2014 03:59:38 UTC] PHP Notice: Uninitialized string offset: 0 in /Applications/MAMP/htdocs/qb/wordpress/wp-content/plugins/content-warning-v2/class/main.class.php on line 114
[03-Sep-2014 03:59:45 UTC] PHP Notice: Uninitialized string offset: 0 in /Applications/MAMP/htdocs/qb/wordpress/wp-content/plugins/content-warning-v2/class/main.class.php on line 114
[03-Sep-2014 03:59:50 UTC] PHP Notice: Uninitialized string offset: 0 in /Applications/MAMP/htdocs/qb/wordpress/wp-content/plugins/content-warning-v2/class/main.class.php on line 114
[03-Sep-2014 04:00:15 UTC] PHP Notice: Uninitialized string offset: 0 in /Applications/MAMP/htdocs/qb/wordpress/wp-content/plugins/content-warning-v2/class/main.class.php on line 114
hello, thanks for this great plugin, one question, i need to hide the dialog on cerain pages, i saw the function here: https://github.com/JayWood/content-warning-v3/wiki/Dev-Documentation#hide-the-dialog-on-certain-pages-regardless-of-cookies
do i place this in my functions.php ?
where do i set the page-ids?
and cookies are not expiring, no matter what is set, but i have seen, that people have already reported this.
thanks for your help! nadia
When using a theme that has the color attribute set to a white color for the page body, site visitors are unable to see the Dialog Message.
While this problem can be resolved by adding custom CSS in the provided space, the plugin would benefit from having a set color for the dialog message so that all users will be able to see the text when first testing the plugin.
In general, it would be a good idea to make sure that the plugin does not use any theme based CSS and instead, overwrites that code with its own to ensure good presentation under all conditions.
Hello!
The plugin was working great while I had it on my testing server, but then once I moved the Wordpress site to my client's server, the plugin is not working as it was before. I deactivated/activated it, as well as uninstalled and re-installed without any luck.
Settings:
Sitewide: Unchecked
Home Page: Checked
Misc. Pages: Unchecked
Cookie Life: Currently 10 days, but the warning shows up every time no matter what the number here says.
The site is not set to a home page, but the latest posts page.
When you first go to the site you will see the warning as intended. Then if you refresh or click the home button it shows again. If you click NO I am not 18 yrs old, it will take you to Google as intended, but then if you revisit the site it will show the warning again. I would like for the warning to show on all pages but I have disabled that for now so that the site is somewhat usable while I try and solve this issue.
This is happening in Chrome, Firefox, IE, and Android native browser (maybe more but these are the ones I've tested).
Website:
http://www.optimalvapor.com
Thank you for any help you can provide. I really like this plugin and it is the best that I've found for the purpose it serves.
Let me know if I can provide more information.
When i upload a background image (from setting panel) the path is present in the field but nothing happens. Default background color still here.
Same thing when i try to customize background button in the appropriate field :
so i tried to directly edit the css, and nothing happens too.
i maybe doing something wrong ?
(my skills : good understanding of css and html, but bad in php, javascript)
http://plugish.com/plugins/content-warning-v3
"This webpage is not available
ERR_CONNECTION_TIMED_OUT"
I'm trying to create conditions that the user must accept before being able to get past the content warning dialog box. For this, I'm using form elements (checkboxes). However, after I insert the html in the dialog message text field in Wordpress admin, the checkbox elements are stripped out on the front end. For example:
<form name="form1" method="post" action="">
<p>
<label>
<input type="checkbox" name="disclaimer" value="facts-circumstances" id="disclaimer_0">
The facts and circumstances of your case may differ from the matters in which results and testimonials have been provided.</label>
<br>
<label>
<input type="checkbox" name="disclaimer" value="results-testimonials" id="disclaimer_1">
All results of cases handled by the firm are not provided and not all clients have given testimonials.</label>
<br>
<label>
<input type="checkbox" name="disclaimer" value="experience-difference" id="disclaimer_2">
The results and testimonials provided are not necessarily representative of results obtained by the firm or of the experience of all clients or others with the firm. Every case is different, and each client's case must be evaluated and handled on its own merits.</label>
</p>
</form>
The front-end output looks like this:
<form name="form1" method="post" action="">
<p>
<label></p>
<p> The facts and circumstances of your case may differ from the matters in which results and testimonials have been provided.</label><br />
<br><br />
<label></p>
<p> All results of cases handled by the firm are not provided and not all clients have given testimonials.</label><br />
<br><br />
<label></p>
<p> The results and testimonials provided are not necessarily representative of results obtained by the firm or of the experience of all clients or others with the firm. Every case is different, and each client's case must be evaluated and handled on its own merits.</label>
</p>
</form>
Hi
I have installed and activated the plug in. Went to set it up for certain categories only, but alas there are no categories to choose from.
I have made sure i have categories in pages and products to see if that could be the issue, but i'm now at a loss and don't understand what else I could try.
Novice trying hard in this computer age!
Any assistance would be greatly appreciated. Thank you
Is it possible to enable sitewide but disable on a specific page only?
Hi Jerry,
I am having trouble to get your plugin working.
I have set it to show up on the home page. And when I check the source code, I can see the custom CSS and also everything in . So I believe it is not loading the JS file.
I have also checked my theme, which is using wp_head() and wp_footer().
Maybe you can think of what's going wrong?
I'm un-sure if this will work with the WooCommerce product and product cat's post type, but it DEFINITELY should.
I need the content box on one page of my site and it is popping up on the main page when it is loaded. I set the only page to be the specific page. Am I missing some super simple action?
To help make the plugin easily adaptable to all styles, Admins would benefit from having a WYSIWYG editor with clickable / selectable styling options. These options could be setup on a separate tab and would work similar to how the current background color options work. This tab should have a preview so that admins can see the changes "on the fly". Options that would be helpful could include:
Text colors
Text Size
Element background colors
Element text colors
Dialog box background colors
Dialog box size
Adjustable border radius for the dialog box and contained elements
These features could be used to generate a premium plugin.
Hi, I have a online Dating site. Would like to warn visitors before enter. But your plugin works fine. But after a few tries you cannot enter the site as the enter and exit buttons stop working. Can you please help?
This is the only plugin out there that offer's this kind of service.
Hey!
Ive tried to customize the box, with the code:
.cwv3_dialog .cwv3_title { background: #F3BB53; }
.cwv3_btns { background: rgba(0,0,0, .0)}
.cwv3_dialog .cwv3_btns .cwv3_enter a {background-color: #738E7A; border-radius: 6px;}
.cwv3_dialog .cwv3_btns .cwv3_exit a {background-color: #738E7A; border-radius: 6px;}
But nothing happens. I am using the newest version of wordpress.
How do i do this?
Plugin Version 3.6.7
WordPress Version 4.4.2
Using WooCommerce Version 2.5.2
MyStile Theme Version 1.3.11
Current Settings:
Sitewide: Enabled
Home Page: Enabled
Misc Pages: Enabled
Cookie Life: 3
Dialog Title: You Must Be Age 18 or Older to Continue
Dialog Message:
Exit Text: Exit
Exit Link: http://google.com
Enter Text: Enter
Enter Link: #
Toggle Denial Option: Not Checked
Denial Handling Method: Redirect the user.
Dialog Title: Access Denied
Denial Message: You have been denied access to this content. If you feel this is in error, please contact a site administrator.
Background Image is defined.
Background Opacity: 0.85
Background Color: Black
Custom CSS: in use
Category Restrictions: None selected.
When a visitor accesses the site and is not logged in, they are presented with the correct prompts and redirects work correctly. After the visitor clicks enter, they are able to view the site until they navigate to another page on the site. When they navigate to a new page on the site, they are re-prompted. This happens on all pages, even if the visitor has already clicked the enter text previously on the same page.
This is an absolutely brilliant plug-in, but I have found one issue: if the user hits exit, the cookie is set as if the user had pressed enter. So if they come back to the site later, there is no warning dialog.
Hi Jay, I installed your plug in and I see potential here but I have a couple pretty serious issues. The Dialog title shows up but not the dialog message. Also, I have uploaded a picture to be used as a background and it is not displaying my image. I checkered the image URL and it is working but not working with your plugin. It just shows my site with barely visible opacity, which is no good for me, as this is an adult based site I need to make sure users do not make it past the content warning page at all or in any form until they agree that they are old enough to enter. Will be looking forward to your reply and thanks in advance.
Hello, and thanks for your awesome plugin.
Default opacity (0.85) seemed so dark, felt like 1. So I went and tried to type 0.60 and save.
But a dialog prompted and said that what I wrote is not valid, and that the closest values to 0.60 are 0.85 and -0.15. Even though the tooltip says a float value from 0 to 1.
Anyway I chose -0.15 and the opacity was exactly the same as 0.85.
So there's the problem. Thanks for your time!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.