84% pubexchange

Code Review | PubExchange

WordPress plugin PubExchange scored84%from 54 tests.

About plugin

  • Plugin page: pubexchange
  • Plugin version: 2.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2.0
  • WordPress version: 6.3.1
  • First release: May 29, 2015
  • Latest release: Apr 5, 2023
  • Number of updates: 19
  • Update frequency: every 151.1 days
  • Top authors: pubexchange (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /3,335 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: ▲0.06MB] [CPU: ▼3.54ms] Passed 4 tests

Server-side resources used by PubExchange
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0640.05 ▲1.02
Dashboard /wp-admin3.36 ▲0.0647.52 ▲1.71
Posts /wp-admin/edit.php3.48 ▲0.1250.11 ▼3.68
Add New Post /wp-admin/post-new.php5.94 ▲0.0584.63 ▼13.22
Media Library /wp-admin/upload.php3.29 ▲0.0537.40 ▲3.83
PubExchange /wp-admin/options-general.php?page=pubexchange_widget3.2631.70

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for PubExchange
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.44 ▲0.061.84 ▲0.1940.87 ▼0.42
Dashboard /wp-admin2,207 ▲255.83 ▲0.93103.08 ▼1.2941.47 ▼0.53
Posts /wp-admin/edit.php2,096 ▲71.97 ▼0.0234.12 ▼5.5730.25 ▼5.50
Add New Post /wp-admin/post-new.php1,532 ▲1818.32 ▲0.66618.11 ▼75.6954.34 ▲1.80
Media Library /wp-admin/upload.php1,395 ▲104.21 ▼0.0299.34 ▼20.1242.20 ▼6.35
PubExchange /wp-admin/options-general.php?page=pubexchange_widget9232.0331.0928.53

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% 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)
Good news, no errors were detected

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
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/pubexchange/widget.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/pubexchange/settings.php:68
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/pubexchange/widget.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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 require attention:
  • Tags: Please reduce the number of tags, currently 16 tag instead of maximum 10
You can look at the official readme.txt

pubexchange/pubexchange_widget.php 92% from 13 tests

The principal PHP file in "PubExchange" v. 2.0.6 is loaded by WordPress automatically on each request
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 ("pubexchange.php" instead of "pubexchange_widget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin358 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP35417350
JavaScript1008

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity21.50
▷ Minimum class complexity10.00
▷ Maximum class complexity33.00
Average method complexity3.64
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods15
▷ Static methods00.00%
▷ Public methods1386.67%
▷ Protected methods00.00%
▷ Private methods213.33%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/qmark.png0.42KB0.35KB▼ 17.44%
img/pubexchange.png1.05KB1.09KB0.00%