84% beedia

Code Review | 小蜜蜂-Beedia|图片管理插件,支持七牛云存储

WordPress plugin 小蜜蜂-Beedia|图片管理插件,支持七牛云存储 scored84%from 54 tests.

About plugin

  • Plugin page: beedia
  • Plugin version: 2.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-4.9.3
  • WordPress version: 6.3.1
  • First release: Apr 6, 2018
  • Latest release: Jun 30, 2018
  • Number of updates: 6
  • Update frequency: every 14.3 days
  • Top authors: snoobee (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /2,594 total downloads

Benchmarks

Plugin footprint 83% 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.07MB] [CPU: ▼2.89ms] Passed 4 tests

Server-side resources used by 小蜜蜂-Beedia|图片管理插件,支持七牛云存储
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0742.20 ▼2.35
Dashboard /wp-admin3.38 ▲0.0845.24 ▼0.62
Posts /wp-admin/edit.php3.49 ▲0.1348.61 ▲2.21
Add New Post /wp-admin/post-new.php5.96 ▲0.0788.03 ▼10.81
Media Library /wp-admin/upload.php3.30 ▲0.0739.66 ▲3.29

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for 小蜜蜂-Beedia|图片管理插件,支持七牛云存储
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲5913.29 ▼1.364.41 ▲2.1439.62 ▼6.30
Dashboard /wp-admin2,222 ▲364.82 ▼0.15107.14 ▼8.7638.80 ▼4.72
Posts /wp-admin/edit.php2,105 ▲162.00 ▼0.0138.62 ▼2.0334.23 ▼2.98
Add New Post /wp-admin/post-new.php1,546 ▲1823.07 ▲4.88671.34 ▲66.6250.47 ▼3.94
Media Library /wp-admin/upload.php1,404 ▲224.12 ▼0.19109.47 ▲8.8947.53 ▲4.57

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% 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
Almost there! Just fix the following items
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/beedia/beedia.php:58
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/beedia/options-page.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Qiniu\\Config' not found in wp-content/plugins/beedia/lib/Qiniu/functions.php:8

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Tags: There were no tags found
You can look at the official readme.txt

beedia/beedia.php 92% from 13 tests

The main PHP file in "小蜜蜂-Beedia|图片管理插件,支持七牛云存储" ver. 2.0.1 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 165 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin2,321 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP213567212,209
JavaScript247111
CSS1051

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity12.76
▷ Minimum class complexity1.00
▷ Maximum class complexity41.00
Average method complexity2.49
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes1694.12%
Methods134
▷ Static methods3727.61%
▷ Public methods10175.37%
▷ Protected methods21.49%
▷ Private methods3123.13%
Functions24
▷ Named functions24100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants220.00%
▷ Class constants880.00%
▷ Public constants8100.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
No PNG files were detected