84% surprise-post-grid

Code Review | Surprise post grid

WordPress plugin Surprise post grid scored84%from 54 tests.

About plugin

  • Plugin page: surprise-post-grid
  • Plugin version: 1.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.7
  • WordPress version: 6.3.1
  • First release: May 5, 2021
  • Latest release: May 5, 2021
  • Number of updates: 8
  • Update frequency: N/A
  • Top authors: smarettheme (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /310 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.16MB] [CPU: ▼0.39ms] Passed 4 tests

Server-side resources used by Surprise post grid
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.2842.95 ▲3.49
Dashboard /wp-admin3.45 ▲0.1544.10 ▼6.88
Posts /wp-admin/edit.php3.50 ▲0.1550.28 ▲2.42
Add New Post /wp-admin/post-new.php7.54 ▲1.6692.78 ▼0.58
Media Library /wp-admin/upload.php3.31 ▲0.0834.42 ▲4.66

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

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

Browser metrics Passed 4 tests

Surprise post grid: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,003 ▲26813.62 ▼0.748.63 ▲6.7854.58 ▲1.09
Dashboard /wp-admin2,278 ▲904.84 ▼1.07105.12 ▼1.6439.57 ▼4.04
Posts /wp-admin/edit.php2,161 ▲722.03 ▼0.0341.01 ▼0.6137.76 ▲2.63
Add New Post /wp-admin/post-new.php6,331 ▲4,81122.19 ▼1.03897.37 ▲251.6351.21 ▼1.45
Media Library /wp-admin/upload.php1,460 ▲694.21 ▼0.0194.43 ▼6.5543.43 ▲1.60
Title Options /wp-admin/admin.php?page=surprise-grid-options#tab=title-options6,2186.48249.4652.89
Shortcode /wp-admin/admin.php?page=surprise-grid-options#tab=shortcode2,1107.79138.7671.33
Read More /wp-admin/admin.php?page=surprise-grid-options#tab=read-more2,1225.8887.8737.14
Meta Options /wp-admin/admin.php?page=surprise-grid-options#tab=meta-options6,2495.73221.3332.09
Pagination /wp-admin/admin.php?page=surprise-grid-options#tab=pagination1,9975.4483.0627.23
Content Options /wp-admin/admin.php?page=surprise-grid-options#tab=content-options6,0996.04188.9129.22

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • _surprise

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/surprise-post-grid/inc/class-surprise-post-grid-init.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (/assets/screenshot-1.png), #2 (/assets/screenshot-2.png), #3 (/assets/screenshot-3.png), #4 (/assets/screenshot-4.png), #5 (/assets/screenshot-5.png), #6 (/assets/screenshot-6.png)
You can take inspiration from this readme.txt

surprise-post-grid/surprise-post-grid.php 92% from 13 tests

"Surprise post grid" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 202 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected36,549 lines of code in 117 files:
LanguageFilesBlank linesComment linesLines of code
SVG50129,028
PO File203,1403,4606,574
CSS82814846,494
PHP631,8508535,872
Sass1592034,672
JavaScript61,2213483,909

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity21.31
▷ Minimum class complexity1.00
▷ Maximum class complexity137.00
Average method complexity6.51
▷ Minimum method complexity1.00
▷ Maximum method complexity52.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes54
▷ Abstract classes23.70%
▷ Concrete classes5296.30%
▷ Final classes00.00%
Methods199
▷ Static methods3517.59%
▷ Public methods19899.50%
▷ Protected methods10.50%
▷ Private methods00.00%
Functions22
▷ Named functions22100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
lib/assets/images/checkerboard.png2.29KB2.54KB0.00%