83% gallery-recent-posts

Code Review | Gallery Recent Posts

WordPress plugin Gallery Recent Posts scored83%from 54 tests.

About plugin

  • Plugin page: gallery-recent-posts
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-4.7.4
  • WordPress version: 6.3.1
  • First release: May 18, 2017
  • Latest release: May 18, 2017
  • Number of updates: 4
  • Update frequency: every 6.0 days
  • Top authors: kamena (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /691 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

An overview of server-side resources used by Gallery Recent Posts
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0238.58 ▼4.76
Dashboard /wp-admin3.33 ▲0.0348.92 ▼4.88
Posts /wp-admin/edit.php3.38 ▲0.0250.02 ▼4.79
Add New Post /wp-admin/post-new.php5.91 ▲0.0295.22 ▼5.49
Media Library /wp-admin/upload.php3.25 ▲0.0239.99 ▲2.42

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Gallery Recent Posts
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.42 ▲0.061.82 ▼0.0842.08 ▲1.10
Dashboard /wp-admin2,195 ▲155.64 ▲0.0493.51 ▲5.5238.30 ▼7.54
Posts /wp-admin/edit.php2,100 ▼01.96 ▼0.0140.06 ▼3.2734.18 ▼2.72
Add New Post /wp-admin/post-new.php1,526 ▼023.11 ▲0.03661.51 ▼11.8367.14 ▲8.44
Media Library /wp-admin/upload.php1,397 ▼34.17 ▲0.01100.15 ▼15.8844.98 ▼3.42

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_gallery_recent_posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/gallery-recent-posts/gallery_recent_posts.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
8 plugin tags: responsive, picture, thumbnail, widget, image...

gallery-recent-posts/gallery_recent_posts.php 85% from 13 tests

The main PHP file in "Gallery Recent Posts" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("gallery-recent-posts.php" instead of "gallery_recent_posts.php")
  • Domain Path: The domain path points to a folder that does not exist ("/languages")

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
Good job! No executable or dangerous file extensions detected92 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1221692

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity3.25
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.64MB with 0.33MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png645.64KB302.43KB▼ 53.16%
screenshot-1.png11.74KB5.90KB▼ 49.75%