83% 51la-analysis

Code Review | 51la Analysis

WordPress plugin 51la Analysis scored83%from 54 tests.

About plugin

  • Plugin page: 51la-analysis
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.1
  • WordPress version: 6.3.1
  • First release: Jan 29, 2022
  • Latest release: Aug 16, 2022
  • Number of updates: 25
  • Update frequency: every 8.0 days
  • Top authors: 51la (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10,000+ active /12,180 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼3.38ms] Passed 4 tests

A check of server-side resources used by 51la Analysis
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.10 ▼4.29
Dashboard /wp-admin3.32 ▲0.0243.63 ▼5.44
Posts /wp-admin/edit.php3.37 ▲0.0242.10 ▼5.38
Add New Post /wp-admin/post-new.php5.90 ▲0.0295.40 ▲2.92
Media Library /wp-admin/upload.php3.24 ▲0.0233.52 ▲1.58
51LA网站统计 /wp-admin/options-general.php?page=51la-analysis-settings3.3731.61

Server storage [IO: ▲0.34MB] [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: 14 new files
Database: no new tables, 14 new options
New WordPress options
_51la_v6_event_
_51la_vendors_sk_
_51la_vendors_mmodule_id_
can_compress_scripts
widget_recent-posts
_51la_vendors_
theysaidso_admin_options
_51la_vendors_ak_
db_upgraded
_51la_site_version_
...

Browser metrics Passed 4 tests

A check of browser resources used by 51la Analysis
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4713.13 ▼1.221.75 ▼0.7142.50 ▼10.42
Dashboard /wp-admin2,213 ▲224.87 ▲0.02106.75 ▲5.0245.74 ▲4.24
Posts /wp-admin/edit.php2,093 ▲41.99 ▼0.0235.81 ▲1.0037.06 ▲3.07
Add New Post /wp-admin/post-new.php1,539 ▲1923.29 ▲0.12604.58 ▼78.8553.73 ▲3.37
Media Library /wp-admin/upload.php1,395 ▲74.18 ▲0.0296.38 ▼20.3943.73 ▼4.22
51LA网站统计 /wp-admin/options-general.php?page=51la-analysis-settings1,0652.0425.21125.84

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin did not uninstall successfully, leaving 14 options in the database
    • _51la_vendors_mmodule_id_
    • widget_recent-posts
    • can_compress_scripts
    • _51la_site_imoport_type_
    • _51la_vendors_
    • db_upgraded
    • _51la_vendors_sk_
    • _51la_vendors_ak_
    • _51la_site_version_
    • _51la_v6_event_
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/51la-analysis/index.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
1 plugin tags: 51la

51la-analysis/index.php 77% from 13 tests

"51la Analysis" version 1.1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("51la-analysis.php" instead of "index.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 377 characters long)

Code Analysis Passed 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
Good job! No executable or dangerous file extensions detected359 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP52526357
SVG1002

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity3.60
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants1090.91%
▷ Class constants19.09%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.30MB with 0.21MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/static/v6-label.png72.00KB20.97KB▼ 70.87%
admin/static/v5-label.png99.97KB22.90KB▼ 77.09%
admin/static/v5-id.png74.09KB24.92KB▼ 66.36%
admin/static/v6-id.png60.95KB19.85KB▼ 67.44%