58% altibox

Code Review | Altibox

WordPress plugin Altibox scored 58% from 54 tests.

About plugin

  • Plugin page: altibox
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7.4
  • WordPress version: 5.9.2
  • First release: Sep 25, 2015
  • Latest release: Apr 27, 2017
  • Number of updates: 12
  • Update frequency: every 48.4 days
  • Top authors: alticreation (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active / 2,156 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼297.80ms] Passed 4 tests

An overview of server-side resources used by Altibox
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1262.62 ▲10.61
Dashboard /wp-admin3.48 ▲0.0634.09 ▲0.09
Posts /wp-admin/edit.php3.70 ▲0.0639.25 ▲1.67
Add New Post /wp-admin/post-new.php6.94 ▼0.0394.23 ▼1,193.53
Media Library /wp-admin/upload.php3.35 ▲0.0525.69 ▲0.59
Altibox /wp-admin/upload.php?page=altibox-settings-page3.3524.40

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 22 new files
Database: no new tables, 2 new options
New WordPress options
altibox_selectors
altibox_version

Browser metrics Passed 4 tests

A check of browser resources used by Altibox
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,884 ▲14016.64 ▲0.9311.79 ▲4.842.26 ▲0.11
Dashboard /wp-admin2,903 ▲426.16 ▲0.01120.19 ▼15.22161.55 ▼1.90
Posts /wp-admin/edit.php2,699 ▲83.23 ▲0.0064.59 ▲0.03141.31 ▼4.92
Add New Post /wp-admin/post-new.php1,760 ▲10621.57 ▲0.40443.57 ▼2.40158.26 ▼5.50
Media Library /wp-admin/upload.php1,706 ▲85.54 ▲0.01153.17 ▲19.56189.36 ▲2.65
Altibox /wp-admin/upload.php?page=altibox-settings-page1,2952.4456.45144.95

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Error in wp-content/plugins/altibox/admin/class-altibox-admin.php+12
    Uncaught ArgumentCountError: Too few arguments to function Altibox_Admin::__construct(), 0 passed in wp-content/plugins/altibox/altibox.php on line 33 and exactly 2 expected in wp-content/plugins/altibox/admin/class-altibox-admin.php:12
    Stack trace:
    #0 wp-content/plugins/altibox/altibox.php(33): Altibox_Admin->__construct()
    #1 wp-includes/class-wp-hook.php(307): deactivate_altibox()
    #2 wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(474): WP_Hook->do_action()
    #4 wp-admin/includes/plugin.php(812): do_action()
  • Uninstaller has failed for this plugin, leaving 22 files (0.05MB) in the plugin directory
    • (new file) admin/assets/css/altibox-admin.css
    • (new file) admin/assets/js/altibox-admin.js
    • (new file) altibox.php
    • (new file) admin/views/includes/altibox-admin-message.php
    • (new file) includes/class-altibox-activator.php
    • (new file) admin/class-altibox-admin.php
    • (new file) admin/index.php
    • (new file) admin/views/includes/altibox-admin-sidebar.php
    • (new file) admin/views/altibox-admin-settings-page.php
    • (new file) LICENSE.txt
    • ...
  • The uninstall procedure has failed, leaving 3 options in the database
    • recovery_mode_email_last_sent
    • altibox_version
    • altibox_selectors

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/altibox/admin/views/includes/altibox-admin-message.php
    • > /wp-content/plugins/altibox/admin/views/includes/altibox-admin-sidebar.php
  • 7× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Undefined variable: message in wp-content/plugins/altibox/admin/views/includes/altibox-admin-message.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'Altibox_Admin' not found in wp-content/plugins/altibox/includes/class-altibox-deactivator.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Altibox' not found in wp-content/plugins/altibox/includes/class-altibox-activator.php:5
    • > PHP Notice
      Undefined variable: message in wp-content/plugins/altibox/admin/views/includes/altibox-admin-message.php on line 1
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/altibox/admin/views/altibox-admin-settings-page.php:1
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/altibox/admin/views/includes/altibox-admin-message.php on line 1
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/altibox/admin/views/includes/altibox-admin-message.php on line 3

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

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
You can take inspiration from this readme.txt

altibox/altibox.php Passed 13 tests

The main PHP file in "Altibox" ver. 0.2 adds more information about the plugin and also serves as the entry point for this plugin
62 characters long description:
Altibox is a lightweight and clean image viewer for WordPress.

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
Good job! No executable or dangerous file extensions detected561 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP13130185465
CSS23295
JavaScript2031

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity3.25
▷ Minimum class complexity1.00
▷ Maximum class complexity10.00
Average method complexity1.55
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods33
▷ Static methods13.03%
▷ Public methods2884.85%
▷ Protected methods00.00%
▷ Private methods515.15%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin