78% sogrid

Code Review | Wordpress Post Grid Layouts with Pagination - Sogrid

WordPress plugin Wordpress Post Grid Layouts with Pagination - Sogrid scored78%from 54 tests.

About plugin

  • Plugin page: sogrid
  • Plugin version: 1.5.2
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jul 5, 2019
  • Latest release: Mar 11, 2021
  • Number of updates: 33
  • Update frequency: every 18.6 days
  • Top authors: delabon (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

300+ active /7,616 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.19MB] [CPU: ▼12.07ms] Passed 4 tests

An overview of server-side resources used by Wordpress Post Grid Layouts with Pagination - Sogrid
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1645.73 ▲1.76
Dashboard /wp-admin3.43 ▲0.1353.93 ▼1.81
Posts /wp-admin/edit.php3.54 ▲0.1952.67 ▼1.05
Add New Post /wp-admin/post-new.php4.73 ▼1.1648.04 ▼44.94
Media Library /wp-admin/upload.php3.35 ▲0.1237.79 ▼0.47

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

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

Browser metrics Passed 4 tests

Wordpress Post Grid Layouts with Pagination - Sogrid: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,921 ▲16013.93 ▼0.339.60 ▲7.6646.09 ▲1.40
Dashboard /wp-admin2,205 ▲285.58 ▼0.0282.71 ▼7.3637.62 ▼4.40
Posts /wp-admin/edit.php2,116 ▲161.98 ▲0.0040.87 ▲1.2438.03 ▼0.28
Add New Post /wp-admin/post-new.php6,207 ▲4,67619.15 ▼4.25911.77 ▲279.2555.23 ▲1.37
Media Library /wp-admin/upload.php1,419 ▲194.22 ▼0.0199.20 ▼9.7942.42 ▼7.28

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/sogrid/src/admin-panel/views/tabs/general.php
    • > /wp-content/plugins/sogrid/src/admin-panel/views/tabs/changelog.php
  • 10× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/sogrid/src/admin-panel/views/menu.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/sogrid/src/admin-panel/views/menu.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/sogrid/src/admin-panel/views/tabs/settings.php:18
    • > PHP Warning
      Use of undefined constant SOGRID_VERSION - assumed 'SOGRID_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/sogrid/src/admin-panel/views/panel.php on line 1
    • > PHP Warning
      Use of undefined constant SOGRID_URL - assumed 'SOGRID_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/sogrid/src/admin-panel/views/tabs/general.php on line 56
    • > PHP Warning
      Use of undefined constant SOGRID_URL - assumed 'SOGRID_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/sogrid/src/admin-panel/views/tabs/general.php on line 45
    • > PHP Warning
      Use of undefined constant SOGRID_URL - assumed 'SOGRID_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/sogrid/src/admin-panel/views/tabs/general.php on line 51
    • > PHP Warning
      Use of undefined constant SOGRID_URL - assumed 'SOGRID_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/sogrid/src/admin-panel/views/tabs/general.php on line 19
    • > PHP Warning
      Use of undefined constant SOGRID_URL - assumed 'SOGRID_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/sogrid/src/admin-panel/views/tabs/general.php on line 31
    • > PHP Warning
      Use of undefined constant SOGRID_URL - assumed 'SOGRID_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/sogrid/src/admin-panel/views/tabs/general.php on line 72

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

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 your attention:
  • Requires at least: Invalid version format
The official readme.txt might help

sogrid/plugin.php 92% from 13 tests

The entry point to "Wordpress Post Grid Layouts with Pagination - Sogrid" version 1.5.2 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("sogrid.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected7,035 lines of code in 82 files:
LanguageFilesBlank linesComment linesLines of code
PHP186156282,994
JavaScript26735271,987
Sass33463831,693
CSS4396224
Markdown1540137

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity7.38
▷ Minimum class complexity1.00
▷ Maximum class complexity43.00
Average method complexity2.08
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes17.69%
▷ Concrete classes1292.31%
▷ Final classes00.00%
Methods80
▷ Static methods2733.75%
▷ Public methods6682.50%
▷ Protected methods1113.75%
▷ Private methods33.75%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
10 PNG files occupy 1.24MB with 0.82MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/admin-panel/img/settings.png373.83KB114.72KB▼ 69.31%
src/admin-panel/img/blockquote-block.png344.13KB114.21KB▼ 66.81%
src/admin-panel/img/blocks.png63.09KB24.15KB▼ 61.72%
src/admin-panel/img/block-settings.png86.88KB24.81KB▼ 71.45%
src/admin-panel/img/bokez-install.png55.18KB21.99KB▼ 60.16%