10% nextgen-galleryview2

Code Review | NextGEN-Galleryview

WordPress plugin NextGEN-Galleryview scored 10% from 54 tests.

About plugin

  • Plugin page: nextgen-galleryview2
  • Plugin version: 1.3.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-4.0
  • WordPress version: 5.8.1
  • First release: Jan 22, 2013
  • Latest release: Jun 7, 2015
  • Number of updates: 17
  • Update frequency: every 55.3 days
  • Top authors: bhubbard (88.24%)imforza (17.65%)

Code review

54 tests

User reviews

6 reviews

Install metrics

1,000+ active / 43,096 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/nextgen-galleryview2/nggGalleryview.php+14
    Methods with the same name as their class will not be constructors in a future version of PHP; nggGalleryview has a deprecated constructor

Server metrics [RAM: ▼1.85MB] [CPU: ▼183.83ms] Passed 4 tests

A check of server-side resources used by NextGEN-Galleryview
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /1.79 ▼1.054.76 ▼22.87
Dashboard /wp-admin1.81 ▼1.263.99 ▼40.68
Posts /wp-admin/edit.php1.81 ▼1.304.55 ▼31.57
Add New Post /wp-admin/post-new.php1.81 ▼3.633.99 ▼640.19
Media Library /wp-admin/upload.php1.81 ▼1.204.16 ▼20.69
Galleryview /wp-admin/admin.php?page=nextgen-galleryview2/documentation.php1.814.12

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 39 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

NextGEN-Galleryview: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,838 ▲23716.25 ▲0.548.90 ▲3.8977.52 ▲3.58
Dashboard /wp-admin2,933 ▲376.12 ▼0.01116.60 ▼12.65164.43 ▼9.69
Posts /wp-admin/edit.php2,743 ▲33.23 ▼0.0164.04 ▲0.52137.63 ▼0.28
Add New Post /wp-admin/post-new.php3,743 ▼7319.13 ▼0.24432.67 ▼77.20159.48 ▼42.51
Media Library /wp-admin/upload.php1,752 ▼05.45 ▼0.08141.35 ▲0.95181.03 ▼7.00
Galleryview /wp-admin/admin.php?page=nextgen-galleryview2/documentation.php1,3907.58230.43128.17

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/nextgen-galleryview2/nggGalleryview.php+14
    Methods with the same name as their class will not be constructors in a future version of PHP; nggGalleryview has a deprecated constructor

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=nextgen-galleryview2/documentation.php
    • > Deprecated in wp-content/plugins/nextgen-galleryview2/nggGalleryview.php+14
    Methods with the same name as their class will not be constructors in a future version of PHP; nggGalleryview has a deprecated constructor
    • > GET request to /wp-admin/admin.php?page=nextgen-galleryview2/documentation.php
    • > Deprecated in wp-content/plugins/nextgen-galleryview2/nggGalleryview.php+100
    Function create_function() is deprecated
    • > GET request to /wp-admin/admin.php?page=nextgen-galleryview2/documentation.php
    • > User notice in wp-includes/functions.php+5663
    add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be an integer representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)

SRP 0% 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
The following issues need your attention
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/nextgen-galleryview2/view/gallery-galleryview.php
    • > /wp-content/plugins/nextgen-galleryview2/documentation.php
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/nextgen-galleryview2/nggGalleryview.php:100
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/nextgen-galleryview2/tests/test-sample.php:3
    • > PHP Fatal error
      require_once(): Failed opening required '/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/nextgen-galleryview2/tests/bootstrap.php on line 3
    • > PHP Notice
      Undefined variable: gallery in wp-content/plugins/nextgen-galleryview2/view/gallery-galleryview.php on line 24
    • > PHP Warning
      require_once(/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/nextgen-galleryview2/tests/bootstrap.php on line 3
    • > PHP Notice
      Trying to get property 'anchor' of non-object in wp-content/plugins/nextgen-galleryview2/view/gallery-galleryview.php on line 24

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=nextgen-galleryview2/documentation.php
    • > Network (severe)
    https://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-6567838737973180&output=html&h=60&slotname=5087794726&adk=2855185524&adf=1082363344&pi=t.ma~as.5087794726&w=468&lmt=1646999958&url=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin.php%3Fpage%3Dnextgen-galleryview2%252Fdocumentation.php&flash=0&wgl=1&dt=1646999957857&bpp=21&bdt=223&idt=396&shv=r20220308&mjsv=m202203090101&ptt=5&saldr=sa&abxe=1&correlator=165626351873&rume=1&frm=20&pv=2&ga_vid=1390048732.1646999958&ga_sid=1646999958&ga_hid=1827126757&ga_fc=0&u_tz=120&u_his=14&u_h=600&u_w=800&u_ah=600&u_aw=800&u_cd=24&u_sd=1&adx=58&ady=1523&biw=785&bih=600&scr_x=0&scr_y=0&eid=44759837%2C42531397%2C44750774%2C31064857%2C31065370%2C31065530%2C31065596%2C31061691%2C31063247%2C31061693&oid=2&pvsid=1137090822363067&pem=919&uas=0&nvt=1&eae=0&fc=640&brdim=0%2C0%2C0%2C0%2C800%2C0%2C800%2C600%2C800%2C600&vis=1&rsz=do%7Co%7CpeEbr%7Cp&abl=XS&pfx=0&fu=0&bc=23&ifi=1&uci=a!1&btvi=1&fsb=1&xpc=FBaNFV5HUP&p=http%3A//wp.com&dtd=423 - Failed to load resource: the server responded with a status of 403 ()

Optimizations

Plugin configuration 83% 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
Please fix the following attributes:
  • Tags: Too many tags (15 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

nextgen-galleryview2/nggGalleryview.php 69% from 13 tests

"NextGEN-Galleryview" version 1.3.5'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:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 265 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("nextgen-galleryview2.php" instead of "nggGalleryview.php")
  • Domain Path: The domain path folder does not exist ("/languages")
  • Text Domain: Please use dashes and lowercase characters for text domains

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
Success! There were no dangerous files found in this plugin1,506 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript52181871,277
PHP56542168
Bourne Shell110642
XML10014
CSS13105

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity4.00
▷ Minimum class complexity1.00
▷ Maximum class complexity7.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
21 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
galleryview/css/themes/light/info.png0.33KB0.21KB▼ 35.99%
galleryview/css/themes/light/panel-prev-big.png0.70KB0.63KB▼ 9.68%
galleryview/css/themes/light/play-big.png0.37KB0.28KB▼ 24.34%
galleryview/css/themes/dark/panel-prev-big.png0.68KB0.63KB▼ 7.35%
galleryview/css/themes/dark/play-big.png0.39KB0.28KB▼ 29.03%