Giter Club home page Giter Club logo

disable-comments's Introduction

Disable Comments for WordPress

Build Status

This is the development respository for the Disable Comments WordPress plugin. Send pull requests here, download the latest stable version there!

Version and compatibility information can be found in the plugin readme file.

License: GPLv3+

Must-Use version

A must-use version of the plugin is also available.

This plugin is maintained by the WPDeveloper.

disable-comments's People

Contributors

abid112 avatar alexclassroom avatar alimuzzaman avatar asif2bd avatar cfoellmann avatar codelingobot avatar dartui avatar dependabot-preview[bot] avatar dependabot[bot] avatar fgilio avatar fxbenard avatar garretthyder avatar grappler avatar imrantushar avatar irojabkhan avatar odie2 avatar peterdavehello avatar priyomukul avatar solarissmoke avatar szepeviktor avatar xhmikosr avatar zoontek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

disable-comments's Issues

Feature Request - Support WooCommerce Reviews

Hey @solarissmoke

Do you feel we could support WooCommerce Reviews or is that something that shouldn't be part of this plugin. Could conditionally load the code so only works when WooCommerce is enabled or a setting is checked.

Anyway here's some actions and filters I've been using;

/***** Disable Reviews ****/

// Remove review metabox from dashboard
function disable_reviews_dashboard() {
    remove_meta_box('woocommerce_dashboard_recent_reviews', 'dashboard', 'normal');
}
add_action('admin_init', 'disable_reviews_dashboard');

// Remove meta boxes for reviews
function remove_comments_metabox_post_types() {
    remove_meta_box('commentsdiv', 'product', 'normal');
}
add_action('add_meta_boxes', 'remove_comments_metabox_post_types', 99);

// Remove Reviews tab from Woocommerce Products
function woo_remove_reviews_tab($tabs) {
    unset($tabs['reviews']);
    return $tabs;
}
add_filter('woocommerce_product_tabs', 'woo_remove_reviews_tab', 98);

function woo_remove_product_reviews_tab() {
    remove_action( 'woocommerce_product_tabs', 'woocommerce_product_reviews_tab', 30);
    remove_action( 'woocommerce_product_tab_panels', 'woocommerce_product_reviews_panel', 30);
}
add_action('init', 'woo_remove_product_reviews_tab', 15);

function remove_enable_reviews() {
    echo '<script>jQuery(".options_group.reviews").remove();</script>';
}
add_action('woocommerce_product_options_reviews', 'remove_enable_reviews');

function remove_review_settings($settings) {
    if (!empty($settings)) {
        $review_settings = array('product_rating_options', 'woocommerce_enable_review_rating', 'woocommerce_review_rating_required', 'woocommerce_review_rating_verification_label', 'woocommerce_review_rating_verification_required', 'product_rating_options');
        foreach($settings as $index => $setting) {
            if (in_array($setting['id'], $review_settings)) {
                unset($settings[$index]);
            }
        }
    }
    return $settings;
}
add_filter('woocommerce_products_general_settings', 'remove_review_settings');

Let me know what you think and I can work on a pull request.

Cheers

mu-plugin

Is it possible to ask for a mu-plugin version with everything disabled and no UI?

array (
  'disabled_post_types' =>
  array (
    0 => 'post',
    1 => 'page',
    2 => 'attachment',
  ),
  'remove_everywhere' => true,
  'permanent' => true,
  'db_version' => 5,
)

Disable Comments blocks the ability to interact with existing Comments on a post

Hello,

I found with existing comments that are listed in the commentsdiv metabox that their actions (Trash, Spam, etc) are all broken due to disable comments.
screen shot 2016-05-18 at 10 58 42 am

Interacting with the comment results in the 'Comments are closed' page;
screen shot 2016-05-18 at 10 58 49 am

@solarissmoke Do you feel it better to disable the action links or allow actions to bypass the redirect conditional? It appears they all have action param so can do a $_GET['action'] check;
http://localhost:8888/comments/wp-admin/comment.php?c=1&action=trashcomment&_wpnonce=333f724816

Thanks

optional or local google fonts

Hi all,
i'm currently trying to get rid of external font loading for our website and replace with local fonts.
I saw that this plugin uses the "DM Sans" font from fonts.googleapis.com.
Is it possible to either include the font files in the plugin, or make the dependency on the font optional (like a checkbox or smth. in the settings)?

In case this is not feasible i can always just comment out the import line in the stylesheet. I would have to do that after every update of the plugin though.

Thank you for offering this plugin for free :)

Notice: Trying to get property of non-object

Notice: Trying to get property of non-object in /somewhere/content/plugins/disable-comments/disable-comments.php on line 326

Changing this :

        public function hide_dashboard_bits(){
		if( 'dashboard' == get_current_screen()->id )
			add_action( 'admin_print_footer_scripts', array( $this, 'dashboard_js' ) );
	}

to this :

        public function hide_dashboard_bits(){
		if( get_current_screen() && 'dashboard' == get_current_screen()->id )
			add_action( 'admin_print_footer_scripts', array( $this, 'dashboard_js' ) );
	}

seems to fix the thing.

Multisite - Remove First Comment fields/functionality from Network Activated Sites

Hey @solarissmoke

While testing my update on a Network Activated site I noticed the First Comment fields under Network Settings;
screen shot 2016-11-07 at 7 21 47 pm

When Comments are disabled Everywhere there's no point in a First Comment being generated on Site creation.

If this is something the plugin should remove then we'll want to not only account for the fields but their saved options and ensure that the First Comment functionality is disabled so new sites don't get an initial comment.

Thoughts?
Thanks

New release?

The last version is from 2017 but the repo seems very active. Do you plan to create a new release which is installable via WP?

"Loading comments" still showing to the user

Hi,
When all comments are disabled, if I open a media from a gallery, I have a short period where users can see "Loading comments", then it disappears (if comments are enabled, it is the same location where we can add a new comment).

I don't know if this plugin can do something about it, but that would be wonderful :-)

Thanks for trying to do something which must be provided by default to Wordpress.

Filter get_comments_number to 0 when comments disabled

Hi @solarissmoke

This initially came up with a PR I tried to make on TwentyNineteen;
WordPress/twentynineteen#676 (comment)

Basically was trying to fully suppress comments, even when some exist.

So I was wondering if you feel it would make sense to filter 'get_comments_number' to return 0 when comments are disabled. This would allow users to suppress comments from their front-end even if comments exist. This would be helpful for users needing to do large spam cleanups that want to completely hide comment functionality until they're done (had this a few times).

Let me know if it makes sense and I can PR this.

Thanks

Wordpress' Blacklist keys should be still usable

I've been using your plugin for a while and I've noticed that sometimes I need to edit blacklist_keys in wp-admin/options-discussion.php.
I need this field because plugins like Contact Form 7 use this one to read banned keywords prevent spam on thieir forms.

How can I do? Could be a solution to make this textare always editable?

jQuery removal of /comments/feed causes Googlebot to pickup and mark as 403 error

Hi @solarissmoke

I recently noticed that in Google Webmasters tool that there was a 403 error on /comments/feed/ and I was wondering why it would pick that up.

After investigation I found the only reference to it was the jquery snippet to strip that link;
jQuery(function($){ $(".widget_meta a[href='http://getlostfindyourself.ca/comments/feed/']").parent().remove(); });

So obviously Googlebot picked up this instance so I'll think on this and come up with a way to strip that link without explicitly using the link in the selector.

Happy for any thoughts
Cheers

Incompatible with Wordpress 5.0

When adding or editing post, the editor is not visible. The error log shows:

PHP Notice:  edit_form_advanced is <strong>deprecated</strong> since version 5.0.0! Use block_editor_meta_box_hidden_fields instead. This action is still supported in the classic editor, but is deprecated in the block editor. in /var/www/wp-includes/functions.php on line 4147

After disabling this plugin, Wordpress goes back to normall - adding posts is possible.

Disable the Comments Metabox

Hello,

Opening a ticket before I implement an enhancement.

On a post through the Screen Options you can enable the 'Comments' metabox even when comments are disabled globally or for that specific post type;
screen shot 2016-05-13 at 11 15 31 am
screen shot 2016-05-13 at 11 15 37 am
screen shot 2016-05-13 at 11 15 43 am

Fix I'm implementing is to remove post_type support for comments.

Cheers

Push 1.0.1 svn tag to WordPress.org

I'm loading this plugin into my project via composer through the wpackagist.org repository. The handling for wpackagist interprets trunk as a development version of the plugin and only considers tags as stable versions. The only way to get composer to allow the trunk version is to specifically setting a lower minimum stability, which I'd prefer not to do. However, the latest tagged version of the plugin is 0.9.2.

Can you please push an svn tag for version 1.0.1?

Option to disable persistent mode on network

Would be nice to allow the "super admins" of a WP MU installation to prevent site admins from entering persistent mode.
This would be an option in the network administration. I do not want my users to know that there is an inversive option since they will eventually change their minds and I will have the hassle to revert the changes

Pingback not removed

In the readme.txt file L60 it says that the pingback is removed, but on a vanilla install (WP 4.9.2) the pingback has been added to the <head>:

<link rel="pingback" href="http://domain.dev/xmlrpc.php">

WooCommerce Order Notes are logged as comments making them available for deletion

Hi @solarissmoke I realized the Delete Comments tool I built for your plugin has a little flaw when WooCommerce is in place on site. It seems WooCommerce stores it's Order Notes as comments. These are all listed for deletion in the Delete Comments tool so I'll have to look into this further and supply a PR to limit the lookup to avoid WooCommerce Order Notes being seen as Comments.
Cheers

Hide other elements based on disable-comments status

Hi,

Im building my wp websites using Timber, and i came to the situation where I need to hide other elements not removed by default by disable-comments. Is there any method I can use to achieve this?

Thank you.

recentcomments styles still loaded in <head>

As per the title, the styles for recentcomments are still loaded in the <head> section of a vanilla install (WP 4.9.2):

<style type="text/css">.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style>

1.10.0 kills Yoast panel, unable to load JS

In version 1.10.0 Disable Comments kills Yoast SEO panel on post.php using Classic editor (Not tested with Gutenbug).

`post.php?post=269&action=edit:292 GET https://***.se/wp-content/plugins/disable-comments/assets/disable-comments.js?ver=5.2.2 net::ERR_ABORTED 404
load-scripts.php?c=0
e,utils&ver=5.2.2:8

post.php?post=269&action=edit:292 GET https://***.se/wp-content/plugins/disable-comments/assets/disable-comments.js?ver=5.2.2 404`

Undefined array key "HTTP_REFERER" in Disable_Comments::is_network_admin()

Hi,

first of all thanks for a great plugin! :) We've been getting some php warnings (E_WARNING: Undefined array key "HTTP_REFERER") from the $_SERVER['HTTP_REFERER'] check here https://github.com/WPDevelopers/disable-comments/blob/master/disable-comments.php#L114. That variable can be empty under certain circumstances, quoting the php.net documentation:: "Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted.".

I think the easiest fix for this is to add an isset check before trying to get the value from $_SERVER['HTTP_REFERER']. Happy to make a PR if you'd like. :)

Please stop showing notice

Every time I activate a plugin, a notice from your plugin pops up if I want to contribute. I click to hide it every time but after every plugin activation there it is again...

comments feed link present

feed_links_extra() in wp-includes/general-template.php

if ( comments_open() || pings_open() || $post->comment_count > 0 ) {
    $title = sprintf( $args['singletitle'], get_bloginfo('name'), $args['separator'], the_title_attribute( array( 'echo' => false ) ) );
    $href = get_post_comments_feed_link( $post->ID );
}

So even if comments and ping are closed the comments feed link is placed in the header. For posts and CPT-s also. E.g. http://domain.wp/post-slug/feed/
What is you opinion on this?

Delete comments messages are hard to translate

obraz

Hi, as you can see on above screenshot it is hard to translate success messages after comments deletion (words page and attachment). Function get_post_type_object should help with getting CPT label from CPT object.

Conflict with CF7 Blacklist

Hi @solarissmoke I came across this while using CF7. They support the comment blacklist as a way to provide more spam filtering controls, more info;
https://contactform7.com/comment-blacklist/

With Disable Comments in place the Settings > Discussions page is removed which removes the ability for CF7 users to access the blacklist.

Wondering if you think I should submit a PR to enable the Discussions page when CF7 is in place.

Thanks

Suppress the 'Latest Comments' block in Gutenberg when comments are disabled everywhere

Hello Samir,

I wanted your thoughts on a small enhancement for further WP 5.0 (Gutenberg) support. In the editor there's a 'Latest Comments' block which if you've disabled comments everywhere would be nice to remove.

screen shot 2019-03-03 at 2 05 59 am

If you've disabled comments but haven't removed them this widget will display those unremoved comments. If there's no comments it just displays a 'No comments to show'.

What are your thoughts on removing the block when Disable Comments is set to everywhere?

Thanks

Adds broken link to script to header

In my case the plugin added the folllowing code to the header, wich gives an error.

<script type='text/javascript' src='http://siteurl.comArray?ver=1'></script>

my client legacy theme is called "Miami" from PunchThemes and with no plugins, adds this to the header.

Persistantly disable comments

Hi,

After a user choose to persistantly disable comments, can I still repair this by adding a new (comment) field in the sgl database?
If yes, what field exactly?

Regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.