10% pz-recentcomments

Code Review | Pz-RecentComments

WordPress plugin Pz-RecentComments scored10%from 54 tests.

About plugin

  • Plugin page: pz-recentcomments
  • Plugin version: 1.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-5.2.3
  • WordPress version: 6.3.1
  • First release: Aug 6, 2016
  • Latest release: Sep 16, 2019
  • Number of updates: 18
  • Update frequency: every 63.2 days
  • Top authors: poporon (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /1,926 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
The following installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/pz-recentcomments/pz-recentcomments.php+124
    Function create_function() is deprecated

Server metrics [RAM: ▼1.91MB] [CPU: ▼58.56ms] Passed 4 tests

Analyzing server-side resources used by Pz-RecentComments
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.384.43 ▼37.14
Dashboard /wp-admin2.11 ▼1.245.62 ▼55.04
Posts /wp-admin/edit.php2.11 ▼1.255.81 ▼41.50
Add New Post /wp-admin/post-new.php2.11 ▼3.785.20 ▼100.56
Media Library /wp-admin/upload.php2.11 ▼1.125.99 ▼25.70

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 7 new options
New WordPress options
widget_pz-recentcomments
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Pz-RecentComments
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.34 ▼1.401.67 ▼0.4440.70 ▼2.44
Dashboard /wp-admin2,206 ▲185.84 ▼0.04100.08 ▼21.5739.89 ▼4.22
Posts /wp-admin/edit.php2,089 ▼02.01 ▼0.0135.87 ▼1.6331.23 ▼7.23
Add New Post /wp-admin/post-new.php1,533 ▼923.22 ▲5.14641.93 ▲2.1562.35 ▲0.34
Media Library /wp-admin/upload.php1,388 ▲64.25 ▲0.0397.66 ▼3.3643.64 ▲2.08

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/pz-recentcomments/pz-recentcomments.php+124
    Function create_function() is deprecated
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_pz-recentcomments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

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
Everything seems fine, however 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 fix the following
  • 1× 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/pz-recentcomments/pz-recentcomments.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots do not have images: #1 ("Download and install."), #2 ("Drag and drop widget."), #3 ("Settings."), #4 ("Look and feel.")
The official readme.txt is a good inspiration

pz-recentcomments/pz-recentcomments.php Passed 13 tests

The primary PHP file in "Pz-RecentComments" version 1.3.2 is used by WordPress to initiate all plugin functionality
23 characters long description:
Recent comments widget.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin202 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP1171889
CSS11175
PO File123848837
JavaScript1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity22.00
▷ Minimum class complexity22.00
▷ Maximum class complexity22.00
Average method complexity5.20
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
4 PNG files occupy 0.08MB with 0.04MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png13.36KB7.15KB▼ 46.51%
screenshot-3.png6.01KB3.40KB▼ 43.51%
screenshot-2.png14.79KB8.22KB▼ 44.43%
screenshot-1.png46.84KB21.61KB▼ 53.87%