78% cleantalk-spam-protect

Code Review | Spam protection, Anti-Spam, FireWall by CleanTalk

WordPress plugin Spam protection, Anti-Spam, FireWall by CleanTalk scored78%from 54 tests.

About plugin

  • Plugin page: cleantalk-spam-pr...
  • Plugin version: 6.22
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4
  • WordPress version: 6.3.1
  • First release: May 18, 2012
  • Latest release: Nov 23, 2023
  • Number of updates: 2,500
  • Update frequency: every 1.2 days
  • Top authors: Safronik (46.76%)shagimuratov (21.36%)Vlad Cleantalk (14.36%)glomberg (12.4%)sartemd174 (4%)

Code review

54 tests

User reviews

2763 reviews

Install metrics

200,000+ active /13,981,514 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲3.21MB] [CPU: ▲19.43ms] Passed 4 tests

A check of server-side resources used by Spam protection, Anti-Spam, FireWall by CleanTalk
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /6.12 ▲2.6561.78 ▲17.23
Dashboard /wp-admin6.71 ▲3.4076.25 ▲14.14
Posts /wp-admin/edit.php6.75 ▲3.4077.16 ▲29.31
Add New Post /wp-admin/post-new.php9.41 ▲3.52113.17 ▲17.05
Media Library /wp-admin/upload.php6.63 ▲3.4064.44 ▲30.37
Find spam comments /wp-admin/edit-comments.php?page=ct_check_spam7.2474.16
Find spam users /wp-admin/users.php?page=ct_check_users7.2965.77
Anti-Spam by CleanTalk /wp-admin/options-general.php?page=cleantalk6.8669.98
All Comments /wp-admin/edit-comments.php6.6965.04
WooCommerce spam orders /wp-admin/admin.php?page=apbct_wc_spam_orders7.1460.78

Server storage [IO: ▲2.89MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 481 new files
Database: 10 new tables, 13 new options
New tables
wp_cleantalk_spamscan_logs
wp_cleantalk_connection_reports
wp_cleantalk_ac_log
wp_cleantalk_no_cookie_data
wp_cleantalk_sessions
wp_cleantalk_ua_bl
wp_cleantalk_sfw_personal
wp_cleantalk_sfw
wp_cleantalk_wc_spam_orders
wp_cleantalk_sfw_logs
New WordPress options
cleantalk_errors
cleantalk_stats
db_upgraded
recovery_mode_email_last_sent
widget_recent-comments
cleantalk_data
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
...

Browser metrics Passed 4 tests

An overview of browser requirements for Spam protection, Anti-Spam, FireWall by CleanTalk
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,208 ▲44615.09 ▲0.797.88 ▲6.0934.15 ▼10.98
Dashboard /wp-admin2,457 ▲2866.34 ▲0.78157.10 ▲59.2188.42 ▲44.18
Posts /wp-admin/edit.php2,297 ▲1972.04 ▲0.0144.42 ▲6.5736.91 ▼1.38
Add New Post /wp-admin/post-new.php1,709 ▲18324.99 ▲1.47643.12 ▼1.7765.24 ▲16.15
Media Library /wp-admin/upload.php1,591 ▲1914.21 ▲0.0399.36 ▲0.6343.86 ▲1.52
Find spam comments /wp-admin/edit-comments.php?page=ct_check_spam1,2621.8432.8729.30
Find spam users /wp-admin/users.php?page=ct_check_users1,2711.8534.7727.21
Anti-Spam by CleanTalk /wp-admin/options-general.php?page=cleantalk2,2203.3747.5181.24
All Comments /wp-admin/edit-comments.php2,0332.3744.8535.61
WooCommerce spam orders /wp-admin/admin.php?page=apbct_wc_spam_orders8631.559.8024.11

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • recovery_mode_email_last_sent
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=apbct_wc_spam_orders
    • > Error in wp-content/plugins/cleantalk-spam-protect/lib/Cleantalk/ApbctWP/WcSpamOrdersListTable.php+288
    Uncaught Error: Call to a member function getApbct() on null in wp-content/plugins/cleantalk-spam-protect/lib/Cleantalk/ApbctWP/WcSpamOrdersListTable.php:288
    Stack trace:
    #0 wp-content/plugins/cleantalk-spam-protect/lib/Cleantalk/ApbctWP/WcSpamOrdersListTable.php(37): Cleantalk\ApbctWP\WcSpamOrdersListTable->generatePageHeader()
    #1 wp-content/plugins/cleantalk-spam-protect/inc/cleantalk-wc-spam-orders.php(18): Cleantalk\ApbctWP\WcSpamOrdersListTable->__construct()
    #2 wp-includes/class-wp-hook.php(310): {closure}()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 wp-admin/admin.php(259): do_action()
    #6 {main}
    thrown

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 100× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Cleantalk\\Antispam\\Integrations\\IntegrationBase' not found in wp-content/plugins/cleantalk-spam-protect/lib/Cleantalk/Antispam/Integrations/LeadFormBuilder.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Cleantalk\\Antispam\\Integrations\\IntegrationBase' not found in wp-content/plugins/cleantalk-spam-protect/lib/Cleantalk/Antispam/Integrations/EstimationForm.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Cleantalk\\ApbctWP\\FindSpam\\ListTable\\Users' not found in wp-content/plugins/cleantalk-spam-protect/lib/Cleantalk/ApbctWP/FindSpam/ListTable/UsersLogs.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Cleantalk\\Antispam\\Integrations\\IntegrationBase' not found in wp-content/plugins/cleantalk-spam-protect/lib/Cleantalk/Antispam/Integrations/Supsystic.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Cleantalk\\Antispam\\Integrations\\IntegrationBase' not found in wp-content/plugins/cleantalk-spam-protect/lib/Cleantalk/Antispam/Integrations/GiveWP.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Cleantalk\\ApbctWP\\FindSpam\\ListTable\\Users' not found in wp-content/plugins/cleantalk-spam-protect/lib/Cleantalk/ApbctWP/FindSpam/ListTable/UsersScan.php:7
    • > PHP Fatal error
      Trait 'Cleantalk\\Templates\\Singleton' not found in wp-content/plugins/cleantalk-spam-protect/lib/Cleantalk/ApbctWP/FindSpam/UsersScanResponse.php on line 8
    • > PHP Fatal error
      Uncaught Error: Class 'Cleantalk\\ApbctWP\\CleantalkListTable' not found in wp-content/plugins/cleantalk-spam-protect/lib/Cleantalk/ApbctWP/WcSpamOrdersListTable.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Cleantalk\\Antispam\\Integrations\\IntegrationBase' not found in wp-content/plugins/cleantalk-spam-protect/lib/Cleantalk/Antispam/Integrations/WpMembers.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Cleantalk\\Common\\Validate' not found in wp-content/plugins/cleantalk-spam-protect/lib/Cleantalk/ApbctWP/Validate.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: anti-spam, firewall, antispam, spam, comments

cleantalk-spam-protect/cleantalk.php 85% from 13 tests

The primary PHP file in "Spam protection, Anti-Spam, FireWall by CleanTalk" version 6.22 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("cleantalk-spam-protect.php" instead of "cleantalk.php")
  • Description: The description should be shorter than 140 characters (currently 146 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin31,439 lines of code in 183 files:
LanguageFilesBlank linesComment linesLines of code
PHP1555,6909,11029,499
PO File1301334892
HTML48512891
SVG11140126
JavaScript1302222
CSS9289

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
It is recommended to fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 106)
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity17.87
▷ Minimum class complexity1.00
▷ Maximum class complexity216.00
Average method complexity3.47
▷ Minimum method complexity1.00
▷ Maximum method complexity106.00
Code structure
Namespaces16
Interfaces0
Traits2
Classes136
▷ Abstract classes85.88%
▷ Concrete classes12894.12%
▷ Final classes00.00%
Methods940
▷ Static methods29731.60%
▷ Public methods75680.43%
▷ Protected methods737.77%
▷ Private methods11111.81%
Functions447
▷ Named functions40590.60%
▷ Anonymous functions429.40%
Constants55
▷ Global constants3869.09%
▷ Class constants1730.91%
▷ Public constants17100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
267 compressed PNG files occupy 0.19MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/images/flags/az.png0.58KB0.75KB0.00%
inc/images/flags/la.png0.55KB0.70KB0.00%
inc/images/flags/sm.png0.49KB0.64KB0.00%
inc/images/flags/hr.png0.51KB0.63KB0.00%
inc/images/flags/uy.png0.52KB0.73KB0.00%