68% rokgallery-pages-list

Code Review | RokGallery Pages List

WordPress plugin RokGallery Pages List scored 68% from 54 tests.

About plugin

  • Plugin page: rokgallery-pages-...
  • Plugin version: 0.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-3.6
  • WordPress version: 5.8.1
  • First release: May 12, 2013
  • Latest release: May 13, 2013
  • Number of updates: 12
  • Update frequency: every 0.1 days
  • Top authors: shazdeh (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 933 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▼1.64MB] [CPU: ▼192.29ms] Passed 4 tests

This is a short check of server-side resources used by RokGallery Pages List
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /1.98 ▼0.749.85 ▼9.91
Dashboard /wp-admin2.01 ▼1.0515.02 ▼37.61
Posts /wp-admin/edit.php2.01 ▼1.109.37 ▼37.53
Add New Post /wp-admin/post-new.php2.01 ▼3.4210.17 ▼662.32
Media Library /wp-admin/upload.php2.01 ▼1.009.71 ▼31.68

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 1 new option
New WordPress options
widget_rokgalleries_list

Browser metrics Passed 4 tests

Checking browser requirements for RokGallery Pages List
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10715.94 ▼0.2012.12 ▲1.3850.93 ▼6.09
Dashboard /wp-admin2,973 ▲365.91 ▼0.04141.11 ▼10.25118.22 ▲2.05
Posts /wp-admin/edit.php2,739 ▼02.72 ▲0.0268.98 ▼2.6695.30 ▲1.36
Add New Post /wp-admin/post-new.php1,683 ▲718.73 ▼0.14403.53 ▲6.03112.21 ▲2.89
Media Library /wp-admin/upload.php1,810 ▼05.03 ▼0.01156.47 ▼1.10117.29 ▼7.51

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-includes/class-wp-hook.php+303
    Non-static method RokGallery_Pages_Lists::register() should not be called statically
  • Zombie WordPress options detected upon uninstall: 1 option
    • widget_rokgalleries_list

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
Please fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/rokgallery-pages-list/views/widget.php
  • 12× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/rokgallery-pages-list/views/widget.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_head() in wp-content/plugins/rokgallery-pages-list/views/rokbox.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/rokgallery-pages-list/init.php:23
    • > PHP Notice
      Undefined variable: title in wp-content/plugins/rokgallery-pages-list/views/widget.php on line 5
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/rokgallery-pages-list/views/widget.php on line 8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/rokgallery-pages-list/views/widget.php on line 27
    • > PHP Notice
      Undefined variable: before_widget in wp-content/plugins/rokgallery-pages-list/views/widget.php on line 3
    • > PHP Notice
      Undefined variable: after_widget in wp-content/plugins/rokgallery-pages-list/views/widget.php on line 24
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/rokgallery-pages-list/views/form.php:2
    • > PHP Notice
      Undefined variable: galleries in wp-content/plugins/rokgallery-pages-list/views/widget.php on line 8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

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
3 plugin tags: widget, rokgallery, gallery

rokgallery-pages-list/init.php 92% from 13 tests

The main PHP script in "RokGallery Pages List" version 0.1.1 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("rokgallery-pages-list.php" instead of "init.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin195 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP43919189
JavaScript1106

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity1.90
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods220.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There were not PNG files found in your plugin