90% smart-post-grid-widget

Code Review | Smart Post Grid Widget

WordPress plugin Smart Post Grid Widget scored90%from 54 tests.

About plugin

  • Plugin page: smart-post-grid-w...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7
  • WordPress version: 6.3.1
  • First release: Feb 10, 2017
  • Latest release: Feb 10, 2017
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: farvehandleren (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /488 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

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

A check of server-side resources used by Smart Post Grid Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0435.92 ▼9.18
Dashboard /wp-admin3.35 ▲0.0042.24 ▼18.65
Posts /wp-admin/edit.php3.40 ▲0.0444.74 ▼1.46
Add New Post /wp-admin/post-new.php5.93 ▲0.0481.06 ▼9.95
Media Library /wp-admin/upload.php3.27 ▲0.0436.08 ▼0.25

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

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

Browser metrics Passed 4 tests

Smart Post Grid Widget: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.65 ▲0.291.65 ▼0.0938.96 ▼5.09
Dashboard /wp-admin2,195 ▲185.63 ▲0.0483.88 ▼19.0139.41 ▼5.87
Posts /wp-admin/edit.php2,103 ▲31.99 ▼0.0134.49 ▼1.6630.61 ▼6.64
Add New Post /wp-admin/post-new.php1,526 ▼223.51 ▲0.37672.81 ▼24.0751.68 ▼10.98
Media Library /wp-admin/upload.php1,403 ▲34.26 ▲0.10105.42 ▲7.3546.27 ▲1.25

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_postgrid_featured_posts_widget
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: post, list, widget, post grid, grid

smart-post-grid-widget/main.php 92% from 13 tests

Analyzing the main PHP file in "Smart Post Grid Widget" version 1.0.0
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 ("smart-post-grid-widget.php" instead of "main.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
No dangerous file extensions were detected252 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP22220168
CSS110161
JavaScript15523

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity21.00
▷ Minimum class complexity21.00
▷ Maximum class complexity21.00
Average method complexity6.00
▷ Minimum method complexity1.00
▷ Maximum method complexity19.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 Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/like-icon-dark.png4.31KB1.94KB▼ 54.91%
images/like-icon-light.png4.25KB1.94KB▼ 54.30%
images/like.png27.13KB10.27KB▼ 62.14%
images/star.png1.31KB1.45KB0.00%
images/like-icon-tp.png17.70KB6.79KB▼ 61.66%