72% ngg-smart-image-search

Code Review | NGG Smart Image Search

WordPress plugin NGG Smart Image Search scored72%from 54 tests.

About plugin

  • Plugin page: ngg-smart-image-s...
  • Plugin version: 3.1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.1-6.0.1
  • WordPress version: 6.3.1
  • First release: Oct 17, 2016
  • Latest release: Jul 17, 2022
  • Number of updates: 20
  • Update frequency: every 105.0 days
  • Top authors: wpo-HR (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

600+ active /6,838 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.43MB] [CPU: ▼3.14ms] Passed 4 tests

A check of server-side resources used by NGG Smart Image Search
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.90 ▲0.4439.18 ▼2.69
Dashboard /wp-admin3.74 ▲0.4054.38 ▼8.42
Posts /wp-admin/edit.php3.86 ▲0.5054.36 ▲10.58
Add New Post /wp-admin/post-new.php6.32 ▲0.4495.35 ▼5.28
Media Library /wp-admin/upload.php3.66 ▲0.4437.20 ▲3.84
NGG Smart Image Search /wp-admin/options-general.php?page=ngg_smart_image_search3.6131.81

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 41 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
widget_hrsis_widget
can_compress_scripts
theysaidso_admin_options
hr_SIS_settings

Browser metrics Passed 4 tests

NGG Smart Image Search: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,905 ▲13413.56 ▼1.055.00 ▲2.7738.21 ▼4.83
Dashboard /wp-admin2,210 ▲195.86 ▲0.94105.56 ▼5.1341.45 ▼6.08
Posts /wp-admin/edit.php2,096 ▲252.04 ▲0.0339.52 ▲2.7836.16 ▼0.69
Add New Post /wp-admin/post-new.php1,536 ▲323.07 ▼0.14587.92 ▼76.8559.22 ▲3.69
Media Library /wp-admin/upload.php1,395 ▲104.19 ▼0.1097.43 ▼4.9342.44 ▼2.84
NGG Smart Image Search /wp-admin/options-general.php?page=ngg_smart_image_search1,2432.2949.1749.03

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • db_upgraded
    • widget_hrsis_widget
    • theysaidso_admin_options
    • hr_SIS_settings
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=ngg_smart_image_search
    • > Warning in wp-admin/includes/plugin.php+294
    opendir(wp-content/plugins/nextgen-gallery): failed to open dir: No such file or directory
    • > GET request to /wp-admin/options-general.php?page=ngg_smart_image_search
    • > Warning in wp-admin/includes/plugin.php+294
    opendir(wp-content/plugins/nextgen-gallery-pro): failed to open dir: No such file or directory

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/ngg-smart-image-search/admin/partials/ngg-smart-image-search-admin-display.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/ngg-smart-image-search/public/class-ngg-smart-image-search-public.php:1676
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/ngg-smart-image-search/admin/class-ngg-smart-image-search-admin.php:430

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

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Tags: Too many tags (18 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

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

The entry point to "NGG Smart Image Search" version 3.1.0 is a PHP file that has certain tags in its header comment area
108 characters long description:
This plugin provides a customizable smart image search and display function for images in NextGEN galleries.

Code Analysis 97% from 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 plugin6,278 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
CSS465462,431
PHP125969682,171
SVG3031,242
PO File1144195425
JavaScript217559

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
Please tend to the following items
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 316)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity53.75
▷ Minimum class complexity1.00
▷ Maximum class complexity343.00
Average method complexity12.11
▷ Minimum method complexity1.00
▷ Maximum method complexity316.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods38
▷ Static methods615.79%
▷ Public methods3386.84%
▷ Protected methods00.00%
▷ Private methods513.16%
Functions23
▷ Named functions2295.65%
▷ Anonymous functions14.35%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected