94% stop-web-crawlers

Code Review | Stop Web Crawlers

WordPress plugin Stop Web Crawlers scored 94% from 54 tests.

About plugin

  • Plugin page: stop-web-crawlers
  • Plugin version: 1.3.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-4.7
  • WordPress version: 5.9.2
  • First release: Jul 8, 2016
  • Latest release: Dec 22, 2016
  • Number of updates: 160
  • Update frequency: every 1.1 days
  • Top authors: threenine (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

400+ active / 4,501 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼299.48ms] Passed 4 tests

An overview of server-side resources used by Stop Web Crawlers
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.1857.64 ▲3.57
Dashboard /wp-admin3.53 ▲0.1340.70 ▲5.88
Posts /wp-admin/edit.php3.76 ▲0.1239.21 ▼1.13
Add New Post /wp-admin/post-new.php6.99 ▲0.0399.07 ▼1,188.21
Media Library /wp-admin/upload.php3.41 ▲0.1126.27 ▼12.14
Add New /wp-admin/admin.php?page=add-web-crawler3.3824.24
Dashboard /wp-admin/admin.php?page=swc_main_menu3.3824.50
List /wp-admin/admin.php?page=web-crawlers-list4.5433.32

Server storage [IO: ▲0.54MB] [DB: ▲0.08MB] Passed 3 tests

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 44 new files
Database: 3 new tables, no new options
New tables
wp_swc_crawler_type
wp_swc_crawlers
wp_swc_crawlers_log

Browser metrics Passed 4 tests

A check of browser resources used by Stop Web Crawlers
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,808 ▲8615.94 ▲0.195.75 ▼0.321.99 ▼0.14
Dashboard /wp-admin2,917 ▲566.18 ▼0.01151.17 ▼25.67188.92 ▲21.25
Posts /wp-admin/edit.php2,728 ▲372.96 ▼0.2867.01 ▼4.00180.89 ▼2.43
Add New Post /wp-admin/post-new.php1,742 ▲3121.16 ▲0.40443.30 ▼39.63180.81 ▲6.04
Media Library /wp-admin/upload.php1,736 ▲385.53 ▼0.01145.68 ▼2.96266.16 ▲70.29
Add New /wp-admin/admin.php?page=add-web-crawler1,0532.3854.18121.04
Dashboard /wp-admin/admin.php?page=swc_main_menu1,3183.91105.62124.97
List /wp-admin/admin.php?page=web-crawlers-list1,6152.4756.65127.19

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
Please take a closer look at the following
  • 8× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/stop-web-crawlers/includes/list-tables/page.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'updater' not found in wp-content/plugins/stop-web-crawlers/includes/swc-db-upgrade/dbscript/_1_3_5.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'updater' not found in wp-content/plugins/stop-web-crawlers/includes/swc-db-upgrade/dbscript/_1_3_6.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/stop-web-crawlers/includes/list-tables/class-swc-list-table.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/stop-web-crawlers/views/dashboard.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/stop-web-crawlers/views/list.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'updater' not found in wp-content/plugins/stop-web-crawlers/includes/swc-db-upgrade/dbscript/_1_3_4.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/stop-web-crawlers/views/addnew.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
9 plugin tags: spam, stop web crawlers, block bot, block bots, seo...

stop-web-crawlers/stop-web-crawlers.php Passed 13 tests

The entry point to "Stop Web Crawlers" version 1.3.6 is a PHP file that has certain tags in its header comment area
77 characters long description:
Blocks over 1400 known referer spammers from directly targeting your website.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin13,918 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP2542316913,812
CSS19055
Markdown147051

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity6.07
▷ Minimum class complexity1.00
▷ Maximum class complexity26.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes16.67%
▷ Concrete classes1493.33%
▷ Final classes1071.43%
Methods47
▷ Static methods510.64%
▷ Public methods2451.06%
▷ Protected methods714.89%
▷ Private methods1634.04%
Functions14
▷ Named functions1392.86%
▷ Anonymous functions17.14%
Constants10
▷ Global constants880.00%
▷ Class constants220.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
8 PNG files occupy 0.09MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/39balls_white.png0.57KB0.55KB▼ 3.24%
images/dashboard_logo.png11.32KB4.77KB▼ 57.88%
images/donate.en.png5.69KB2.78KB▼ 51.14%
images/stop-web-crawlers.png1.09KB1.32KB0.00%
images/WordPressMaintenance.png53.39KB18.42KB▼ 65.49%