10% legi-display

Code Review | Legi Display

WordPress plugin Legi Display scored 10% from 54 tests.

About plugin

  • Plugin page: legi-display
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.5
  • WordPress version: 6.3.1
  • First release: Jul 29, 2014
  • Latest release: Apr 17, 2016
  • Number of updates: 16
  • Update frequency: every 39.3 days
  • Top authors: sedLex (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 855 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/legi-display/core.class.php+1698
    Methods with the same name as their class will not be constructors in a future version of PHP; coreSLframework has a deprecated constructor

Server metrics [RAM: ▲0.00MB] [CPU: ▼4.82ms] Passed 4 tests

An overview of server-side resources used by Legi Display
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.16 ▲0.07
Dashboard /wp-admin3.31 ▲0.0045.25 ▼3.33
Posts /wp-admin/edit.php3.36 ▲0.0047.59 ▲0.57
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.85 ▼16.59
Media Library /wp-admin/upload.php3.23 ▲0.0034.01 ▲0.82

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 159 new files
Database: 1 new table, 7 new options
New tables
wp_pluginSL_legi_display
New WordPress options
can_compress_scripts
legi_display_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Legi Display
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.44 ▼0.851.63 ▲0.0938.88 ▼2.74
Dashboard /wp-admin2,209 ▲175.84 ▲0.9193.78 ▼19.4639.84 ▼2.86
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0639.31 ▼0.6734.61 ▼0.47
Add New Post /wp-admin/post-new.php1,514 ▼2021.58 ▼1.42703.02 ▲97.0557.90 ▲5.36
Media Library /wp-admin/upload.php1,388 ▼34.21 ▲0.0294.83 ▼4.0840.76 ▼1.18

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/legi-display/core.class.php+1698
    Methods with the same name as their class will not be constructors in a future version of PHP; coreSLframework has a deprecated constructor
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/legi-display/legi-display.php
    • > /wp-content/plugins/legi-display/core.class.php
    • > /wp-content/plugins/legi-display/core.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      require_once(core.php): failed to open stream: No such file or directory in wp-content/plugins/legi-display/core/templates/my-plugin.php on line 18
    • > PHP Fatal error
      require_once(): Failed opening required 'core.php' (include_path='.:/usr/share/php') in wp-content/plugins/legi-display/core/templates/my-plugin.php on line 18

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (A comparison feature of different version of an article), #2 (The hierarchy tree of a code)
The official readme.txt might help

legi-display/legi-display.php 92% from 13 tests

The entry point to "Legi Display" version 1.0.5 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 197 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin18,134 lines of code in 71 files:
LanguageFilesBlank linesComment linesLines of code
PO File323,87908,452
PHP191,1521,9878,027
JavaScript5206229778
CSS1111814762
Markdown120084
JSON10029
INI2002

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Please tend to the following items
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 119)
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity63.05
▷ Minimum class complexity1.00
▷ Maximum class complexity289.00
Average method complexity7.74
▷ Minimum method complexity1.00
▷ Maximum method complexity119.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes19
▷ Abstract classes15.26%
▷ Concrete classes1894.74%
▷ Final classes00.00%
Methods175
▷ Static methods3620.57%
▷ Public methods17298.29%
▷ Protected methods31.71%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
36 compressed PNG files occupy 0.58MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
core/img/arrow_down.png0.27KB0.27KB0.00%
core/img/tab_trad.png0.90KB1.08KB0.00%
core/img/tab_list.png0.52KB0.43KB▼ 17.07%
core/img/tree_node_plus.png0.15KB0.13KB▼ 12.50%
core/img/progressbar.png1.43KB1.25KB▼ 12.96%