68% spectacula-threaded-comments

Code Review | Spectacu.la Discussion

WordPress plugin Spectacu.la Discussion scored68%from 54 tests.

About plugin

  • Plugin page: spectacula-thread...
  • Plugin version: 2.3.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.8.1
  • WordPress version: 6.3.1
  • First release: Dec 17, 2009
  • Latest release: Oct 9, 2020
  • Number of updates: 134
  • Update frequency: every 34.3 days
  • Top authors: spectacula (85.82%)TJNowell (11.94%)chiquita (3.73%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /17,033 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.03MB] [CPU: ▼9.89ms] Passed 4 tests

This is a short check of server-side resources used by Spectacu.la Discussion
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0439.30 ▼4.03
Dashboard /wp-admin3.35 ▲0.0050.37 ▼19.85
Posts /wp-admin/edit.php3.46 ▲0.1050.80 ▼3.44
Add New Post /wp-admin/post-new.php5.92 ▲0.0488.08 ▼12.23
Media Library /wp-admin/upload.php3.27 ▲0.0438.02 ▼1.68
Spectacu.la Discussion /wp-admin/options-general.php?page=spectacula_threaded_comments3.2335.09

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 59 new files
Database: 1 new table, 7 new options
New tables
wp_spec_comment_log
New WordPress options
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
spec_comment_dbv
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Spectacu.la Discussion
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲5813.24 ▼1.141.63 ▼0.6041.48 ▼3.57
Dashboard /wp-admin2,225 ▲224.86 ▼1.02105.74 ▼8.0842.89 ▼1.27
Posts /wp-admin/edit.php2,104 ▲72.00 ▼0.0139.41 ▲1.8334.64 ▼2.32
Add New Post /wp-admin/post-new.php6,224 ▲4,69819.05 ▲1.46945.61 ▲270.3752.12 ▲0.71
Media Library /wp-admin/upload.php1,404 ▲74.22 ▲0.00111.01 ▲6.9248.86 ▲5.34
Spectacu.la Discussion /wp-admin/options-general.php?page=spectacula_threaded_comments1,1332.2126.9725.10

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
  • Zombie tables detected upon uninstall: 1 table
    • wp_spec_comment_log
  • The uninstall procedure has failed, leaving 7 options in the database
    • spec_comment_dbv
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

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)
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=spectacula_threaded_comments
    • > Warning in wp-content/plugins/spectacula-threaded-comments/includes/functions.php+117
    closedir() expects parameter 1 to be resource, string given

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
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/spectacula-threaded-comments/includes/db.php:93
    • > PHP Fatal error
      Uncaught Error: Call to undefined function comments_open() in wp-content/plugins/spectacula-threaded-comments/includes/template.php:10
    • > PHP Notice
      Undefined index: wp_version in wp-content/plugins/spectacula-threaded-comments/commenting.php on line 18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/spectacula-threaded-comments/includes/options-page.php:265
    • > PHP Fatal error
      Uncaught Error: Call to undefined function set_url_scheme() in wp-content/plugins/spectacula-threaded-comments/commenting.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === spectacula-threaded-comments === )
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Will work on both dark and light themes thanks to alternative stylesheet), #2 (The control interface for this plug-in.)
The official readme.txt might help

spectacula-threaded-comments/commenting.php 92% from 13 tests

The main PHP script in "Spectacu.la Discussion" version 2.3.4 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("spectacula-threaded-comments.php" instead of "commenting.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin9,971 lines of code in 42 files:
LanguageFilesBlank linesComment linesLines of code
JSON5005,807
PHP74375651,471
CSS4177321,089
JavaScript14192190838
HTML9190450
PO File2129166276
Markdown127040

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity40.14
▷ Minimum class complexity1.00
▷ Maximum class complexity115.00
Average method complexity5.72
▷ Minimum method complexity1.00
▷ Maximum method complexity67.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods58
▷ Static methods00.00%
▷ Public methods5696.55%
▷ Protected methods00.00%
▷ Private methods23.45%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants21
▷ Global constants21100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
style/arrow-left-alt.png0.61KB0.47KB▼ 21.86%
style/badge-new.png0.50KB0.37KB▼ 25.83%
style/system-error.png0.40KB0.32KB▼ 20.53%