84% ngg-image-search

Code Review | NGG Image Search

WordPress plugin NGG Image Search scored84%from 54 tests.

About plugin

  • Plugin page: ngg-image-search
  • Plugin version: 0.01
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.7-4.9.7
  • WordPress version: 6.3.1
  • First release: Jul 10, 2018
  • Latest release: Jul 11, 2018
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: benjamin.owens (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /582 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼8.12ms] Passed 4 tests

An overview of server-side resources used by NGG Image Search
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0238.27 ▼13.60
Dashboard /wp-admin3.33 ▲0.0350.40 ▼4.17
Posts /wp-admin/edit.php3.38 ▲0.0250.11 ▼2.58
Add New Post /wp-admin/post-new.php5.91 ▲0.0292.17 ▼9.74
Media Library /wp-admin/upload.php3.25 ▲0.0234.30 ▼4.98

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

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

Browser metrics Passed 4 tests

A check of browser resources used by NGG Image Search
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲6013.20 ▼1.051.63 ▼0.1547.47 ▲1.50
Dashboard /wp-admin2,224 ▲215.76 ▲0.89101.80 ▼18.9338.52 ▼7.50
Posts /wp-admin/edit.php2,085 ▼152.01 ▼0.0439.84 ▼2.8835.11 ▼0.48
Add New Post /wp-admin/post-new.php1,551 ▲1923.17 ▲0.04668.22 ▼40.2061.13 ▼3.37
Media Library /wp-admin/upload.php1,406 ▲94.21 ▲0.09106.95 ▼15.8845.23 ▼8.52

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 8× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'Mixin_Display_Type_Form' not found in wp-content/plugins/ngg-image-search/product/modules/DisplayType/Form.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'C_Base_Product' not found in wp-content/plugins/ngg-image-search/product/product.FIS.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Mixin' not found in wp-content/plugins/ngg-image-search/product/modules/DisplayType/Controller.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/ngg-image-search/ngg-image-search.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'C_Gallery_Display_Installer' not found in wp-content/plugins/ngg-image-search/product/modules/DisplayType/Installer.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mixin' not found in wp-content/plugins/ngg-image-search/product/modules/DisplayType/Mapper.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'C_Base_Module' not found in wp-content/plugins/ngg-image-search/product/modules/DisplayType/module.DisplayType.php:10
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/ngg-image-search/product/modules/DisplayType/templates/display.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Please add at least on tag
  • Contributors: Contributors not specified
You can take inspiration from this readme.txt

ngg-image-search/ngg-image-search.php Passed 13 tests

This is the main PHP file of "NGG Image Search" version 0.01, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
49 characters long description:
Adds a searchable display type to NextGen Gallery

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin625 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP88886471
PO File2222686
CSS17140
JavaScript23028

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity6.88
▷ Minimum class complexity1.00
▷ Maximum class complexity21.00
Average method complexity2.64
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods27
▷ Static methods00.00%
▷ Public methods27100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants7
▷ Global constants7100.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
PNG images were not found in this plugin