94% gridy-portfolio

Code Review | Gridy Portfolio

WordPress plugin Gridy Portfolio scored 94% from 54 tests.

About plugin

  • Plugin page: gridy-portfolio
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1+
  • WordPress version: 5.8.1
  • First release: Apr 16, 2015
  • Latest release: Sep 14, 2015
  • Number of updates: 19
  • Update frequency: every 8.0 days
  • Top authors: gangesh (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,839 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

A check of server-side resources used by Gridy Portfolio
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.0434.78 ▼3.48
Dashboard /wp-admin3.09 ▲0.0346.26 ▲2.91
Posts /wp-admin/edit.php3.14 ▲0.0343.51 ▼3.42
Add New Post /wp-admin/post-new.php5.44 ▲0.0186.04 ▼563.28
Media Library /wp-admin/upload.php3.03 ▲0.0333.88 ▲1.87
Add Portfolio item /wp-admin/post-new.php?post_type=gportfolio3.1451.81
Category /wp-admin/edit-tags.php?taxonomy=gportfolio-category&post_type=gportfolio3.0332.12
G Portfolio /wp-admin/edit.php?post_type=gportfolio3.0733.19

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 23 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Gridy Portfolio
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,854 ▲28216.79 ▲1.2519.84 ▲9.5168.95 ▲24.36
Dashboard /wp-admin3,010 ▲765.95 ▲0.01139.60 ▼12.22106.90 ▼9.08
Posts /wp-admin/edit.php2,779 ▲402.72 ▲0.0163.22 ▼21.4183.82 ▼6.47
Add New Post /wp-admin/post-new.php1,698 ▲1718.87 ▲3.63402.30 ▼2.63107.51 ▼3.82
Media Library /wp-admin/upload.php1,850 ▲435.01 ▼0.03150.72 ▼0.14123.97 ▲18.62
Add Portfolio item /wp-admin/post-new.php?post_type=gportfolio3,1878.96226.49137.10
Category /wp-admin/edit-tags.php?taxonomy=gportfolio-category&post_type=gportfolio1,7792.3860.8681.27
G Portfolio /wp-admin/edit.php?post_type=gportfolio1,4362.6463.5374.58

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% 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 50% 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 trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/gridy-portfolio/gportfolio.php:13

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

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: grid portfolio, portfolio, grid, expandable

gridy-portfolio/gportfolio.php 92% from 13 tests

Analyzing the main PHP file in "Gridy Portfolio" version 1.0
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("gridy-portfolio.php" instead of "gportfolio.php")

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 detected1,898 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
SVG200702
CSS411932541
JavaScript4127120446
PHP14722209

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/ico-delete.png0.70KB0.72KB0.00%
images/more.png4.22KB1.06KB▼ 74.84%
images/expand.png1.04KB0.19KB▼ 81.70%