78% smart-post-grid

Code Review | Smart Post Grid

WordPress plugin Smart Post Grid scored78%from 54 tests.

About plugin

  • Plugin page: smart-post-grid
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7
  • WordPress version: 6.3.1
  • First release: Jan 4, 2017
  • Latest release: May 17, 2018
  • Number of updates: 22
  • Update frequency: every 23.0 days
  • Top authors: lampd (95.45%)cactusthemes (9.09%)

Code review

54 tests

User reviews

5 reviews

Install metrics

200+ active /11,216 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

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

This is a short check of server-side resources used by Smart Post Grid
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0334.40 ▼4.83
Dashboard /wp-admin3.33 ▲0.0345.17 ▼4.25
Posts /wp-admin/edit.php3.38 ▲0.0248.87 ▲2.88
Add New Post /wp-admin/post-new.php5.93 ▲0.0494.98 ▼0.84
Media Library /wp-admin/upload.php3.25 ▲0.0234.49 ▲1.33

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 28 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Smart Post Grid
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,938 ▲19213.81 ▼0.548.27 ▲6.4440.45 ▼6.57
Dashboard /wp-admin2,228 ▲404.90 ▲0.02122.02 ▲3.6441.15 ▼5.03
Posts /wp-admin/edit.php2,111 ▲222.03 ▲0.0240.07 ▲1.9934.97 ▲0.36
Add New Post /wp-admin/post-new.php1,542 ▲2818.31 ▲0.83596.63 ▼106.9056.89 ▼10.65
Media Library /wp-admin/upload.php1,413 ▲254.32 ▲0.08100.63 ▼7.8243.64 ▼7.90

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 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
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/smart-post-grid/admin/googlefont.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/smart-post-grid/admin/plugin-options.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/smart-post-grid/cactus-smart-post-grid.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Donate link: Invalid url: ""
Please take inspiration from this readme.txt

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

"Smart Post Grid" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("smart-post-grid.php" instead of "cactus-smart-post-grid.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin5,102 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
CSS761322,719
PHP3153761,261
SVG210578
JavaScript57251362
PO File18081182

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity223.00
▷ Minimum class complexity223.00
▷ Maximum class complexity223.00
Average method complexity14.88
▷ Minimum method complexity1.00
▷ Maximum method complexity81.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods16.25%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions20
▷ Named functions20100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected