79% twosides

Code Review | TwoSides

WordPress plugin TwoSides scored79%from 54 tests.

About plugin

  • Plugin page: twosides
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.2
  • WordPress version: 6.3.1
  • First release: Mar 31, 2023
  • Latest release: Apr 13, 2023
  • Number of updates: 23
  • Update frequency: every 0.6 days
  • Top authors: tradesouthwest@gmail.com (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /230 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼6.78ms] Passed 4 tests

This is a short check of server-side resources used by TwoSides
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.40 ▼0.0621.04 ▼20.34
Dashboard /wp-admin3.36 ▲0.0645.24 ▼2.05
Posts /wp-admin/edit.php3.45 ▲0.0945.97 ▲4.57
Add New Post /wp-admin/post-new.php5.94 ▲0.0686.90 ▼8.11
Media Library /wp-admin/upload.php3.26 ▲0.0433.18 ▲3.39

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 23 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
twosides_debate_date_plugin_activated
can_compress_scripts
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for TwoSides
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,056 ▲31015.53 ▲1.155.64 ▲3.8537.20 ▼10.73
Dashboard /wp-admin2,379 ▲1916.64 ▲0.63141.29 ▲36.5944.19 ▲7.72
Posts /wp-admin/edit.php2,282 ▲1903.67 ▲1.6649.87 ▲8.0129.32 ▼5.04
Add New Post /wp-admin/post-new.php1,544 ▲3023.34 ▲5.71616.04 ▼46.7335.26 ▼25.99
Media Library /wp-admin/upload.php1,418 ▲274.35 ▲0.1279.19 ▼17.4940.86 ▼2.22

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
  • 10× PHP files output text when accessed directly:
    • > /wp-content/plugins/twosides/includes/twosides-debate-admin-forms.php
    • > /wp-content/plugins/twosides/index.php
    • > /wp-content/plugins/twosides/includes/twosides-debate-shortcodes.php
    • > /wp-content/plugins/twosides/twosides.php
    • > /wp-content/plugins/twosides/includes/twosides-debate-admin-settings.php
    • > /wp-content/plugins/twosides/includes/twosides-debate-functions.php
    • > /wp-content/plugins/twosides/includes/twosides-debate-helpers.php
    • > /wp-content/plugins/twosides/library/index.php
    • > /wp-content/plugins/twosides/includes/index.php
    • > /wp-content/plugins/twosides/languages/index.php
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/twosides/templates/twosides-debate-comments_templater.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function comments_open() in wp-content/plugins/twosides/templates/comments.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/twosides/templates/twosides-comments_templater.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
9 plugin tags: split comments, catalog, responsive, opinions, metabox...

twosides/twosides.php Passed 13 tests

The main file in "TwoSides" v. 1.1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
95 characters long description:
Display comments in a side by side fashion and divide each side as positive or negative styled.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin1,480 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP121464161,190
CSS255275
JavaScript22113
Markdown1102

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions57
▷ Named functions5698.25%
▷ Anonymous functions11.75%
Constants3
▷ Global constants3100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
library/imgs/icon-128x128.png4.51KB2.95KB▼ 34.75%