10% phpsword-disable-comments

Code Review | PhpSword Disable Comments

WordPress plugin PhpSword Disable Comments scored10%from 54 tests.

About plugin

  • Plugin page: phpsword-disable-...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.0
  • WordPress version: 6.3.1
  • First release: Nov 30, 2014
  • Latest release: Jul 31, 2022
  • Number of updates: 11
  • Update frequency: every 254.5 days
  • Top authors: phpsword (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active /4,493 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/phpsword-disable-comments/index.php+9
    Methods with the same name as their class will not be constructors in a future version of PHP; PhpswDC has a deprecated constructor

Server metrics [RAM: ▼1.82MB] [CPU: ▼56.47ms] Passed 4 tests

A check of server-side resources used by PhpSword Disable Comments
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.16 ▼1.305.67 ▼39.08
Dashboard /wp-admin2.18 ▼1.125.71 ▼47.96
Posts /wp-admin/edit.php2.18 ▼1.175.20 ▼41.76
Add New Post /wp-admin/post-new.php2.18 ▼3.706.20 ▼97.09
Media Library /wp-admin/upload.php2.18 ▼1.055.15 ▼28.76

Server storage [IO: ▲0.05MB] [DB: ▲0.00MB] Passed 3 tests

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
db_upgraded
PhpswDCOptions
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

PhpSword Disable Comments: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲8114.47 ▲0.091.78 ▼0.0844.80 ▲0.71
Dashboard /wp-admin2,222 ▲344.84 ▼0.05112.31 ▼3.3241.24 ▼6.08
Posts /wp-admin/edit.php2,108 ▲192.04 ▼0.0035.24 ▼1.8631.95 ▼4.64
Add New Post /wp-admin/post-new.php1,548 ▲2923.36 ▼0.03655.58 ▲6.4752.45 ▲2.57
Media Library /wp-admin/upload.php1,404 ▲164.18 ▼0.0298.64 ▼0.8444.20 ▲0.56

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/phpsword-disable-comments/index.php+9
    Methods with the same name as their class will not be constructors in a future version of PHP; PhpswDC has a deprecated constructor
  • Zombie WordPress options detected upon uninstall: 7 options
    • PhpswDCOptions
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/phpsword-disable-comments/index.php:353

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 errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: disable comments, turn off comment, phpsword, comments, wordpress...

phpsword-disable-comments/index.php 92% from 13 tests

The entry point to "PhpSword Disable Comments" version 1.1 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("phpsword-disable-comments.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected287 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP14638287

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity73.00
▷ Minimum class complexity73.00
▷ Maximum class complexity73.00
Average method complexity4.79
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/phpswdc.png0.84KB0.90KB0.00%