78% picture-bed-base-on-gitee

Code Review | picture bed base on gitee

WordPress plugin picture bed base on gitee scored78%from 54 tests.

About plugin

  • Plugin page: picture-bed-base-...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.3.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6.0-6.0.1
  • WordPress version: 6.3.1
  • First release: Jul 19, 2022
  • Latest release: Jul 19, 2022
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: rorinl (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /223 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.13MB] [CPU: ▼6.81ms] Passed 4 tests

Server-side resources used by picture bed base on gitee
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1543.09 ▲4.68
Dashboard /wp-admin3.45 ▲0.1049.68 ▼19.22
Posts /wp-admin/edit.php3.56 ▲0.2058.96 ▲1.77
Add New Post /wp-admin/post-new.php6.03 ▲0.14103.68 ▼10.68
Media Library /wp-admin/upload.php3.37 ▲0.1437.62 ▲0.90
Gitee图床 /wp-admin/options-general.php?page=picture-bed-base-on-gitee/functions.php3.3542.94

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 1,402 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

picture bed base on gitee: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲8913.34 ▼1.362.02 ▲0.4329.28 ▼11.20
Dashboard /wp-admin2,213 ▲315.17 ▼0.64116.14 ▲12.2857.09 ▲12.22
Posts /wp-admin/edit.php2,105 ▲162.26 ▲0.0837.84 ▲2.0348.04 ▲8.71
Add New Post /wp-admin/post-new.php1,767 ▲25320.67 ▲3.19692.22 ▲16.5057.28 ▲3.50
Media Library /wp-admin/upload.php1,392 ▲44.35 ▲0.15106.42 ▲5.6653.93 ▲8.60
Gitee图床 /wp-admin/options-general.php?page=picture-bed-base-on-gitee/functions.php1,2992.1032.21105.09

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=picture-bed-base-on-gitee/functions.php
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/picture-bed-base-on-gitee/class/GiteeAPI.php+158
    Undefined index: filters
    • > GET request to /wp-admin/options-general.php?page=picture-bed-base-on-gitee/functions.php
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/picture-bed-base-on-gitee/class/GiteeAPI.php+355
    Invalid argument supplied for foreach()

SRP 50% 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
The following issues need your attention
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/picture-bed-base-on-gitee/functions.php:92
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_clear_scheduled_hook() in wp-content/plugins/picture-bed-base-on-gitee/uninstall.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'PBBOG_Action' not found in wp-content/plugins/picture-bed-base-on-gitee/class/GiteeAPI.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/picture-bed-base-on-gitee/api.php:52
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/picture-bed-base-on-gitee/picture-bed-base-on-gitee.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (imgs/screenshot-1.png), #2 (imgs/screenshot-2.png)
  • Donate link: Please fix this invalid url: ""
You can look at the official readme.txt

picture-bed-base-on-gitee/picture-bed-base-on-gitee.php Passed 13 tests

The main PHP file in "picture bed base on gitee" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
89 characters long description:
picture bed base on gitee,基于Gitee的图床,可以将图片,文件上传到Gitee仓库

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected27,564 lines of code in 1,391 files:
LanguageFilesBlank linesComment linesLines of code
CSS31,217710,532
HTML314105,947
SVG1,371004,677
JavaScript59163764,028
JSON1001,372
PHP847921,008

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity17.67
▷ Minimum class complexity1.00
▷ Maximum class complexity40.00
Average method complexity3.80
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods16
▷ Static methods16100.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions1090.91%
▷ Anonymous functions19.09%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 PNG files occupy 0.50MB with 0.32MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-128x128.png31.95KB12.90KB▼ 59.63%
assets/imgs/screenshot-1.png79.76KB26.51KB▼ 66.76%
assets/banner-772x250.png246.77KB62.72KB▼ 74.58%
assets/icon-256x256.png103.09KB38.68KB▼ 62.47%
assets/imgs/screenshot-2.png53.33KB25.53KB▼ 52.13%