74% wp-mini-program

Code Review | Mini Program API

WordPress plugin Mini Program API scored74%from 54 tests.

About plugin

  • Plugin page: wp-mini-program
  • Plugin version: 1.4.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.8-6.2.2
  • WordPress version: 6.3.1
  • First release: Jul 30, 2019
  • Latest release: Aug 1, 2023
  • Number of updates: 77
  • Update frequency: every 19.0 days
  • Top authors: imahui (100%)

Code review

54 tests

User reviews

1 review

Install metrics

500+ active /19,758 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲1.79MB] [CPU: ▲12.26ms] 75% from 4 tests

A check of server-side resources used by Mini Program API
Please fix the following
  • CPU: The total CPU usage must kept under 500.00ms (currently 1,131.93ms on /wp-admin/admin.php?page=miniprogram)
PageMemory (MB)CPU Time (ms)
Home /5.18 ▲1.7261.05 ▲22.16
Dashboard /wp-admin5.13 ▲1.8365.78 ▲11.64
Posts /wp-admin/edit.php5.20 ▲1.8465.09 ▲11.81
Add New Post /wp-admin/post-new.php7.79 ▲1.90102.89 ▲9.98
Media Library /wp-admin/upload.php4.98 ▲1.7553.10 ▲15.59
基本设置 /wp-admin/admin.php?page=miniprogram4.981,131.93
使用指南 /wp-admin/admin.php?page=guide4.9848.72
任务列表 /wp-admin/admin.php?page=task4.9851.43
订阅统计 /wp-admin/admin.php?page=subscribe4.9854.43

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

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

Browser metrics Passed 4 tests

Mini Program API: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,059 ▲29815.09 ▲0.682.35 ▲0.5841.30 ▼7.16
Dashboard /wp-admin2,465 ▲2886.42 ▲0.77125.39 ▲39.1061.94 ▲19.87
Posts /wp-admin/edit.php2,305 ▲2053.72 ▲1.7453.59 ▲12.2249.15 ▲12.87
Add New Post /wp-admin/post-new.php1,626 ▲10023.09 ▼0.52669.15 ▼18.4964.00 ▲5.57
Media Library /wp-admin/upload.php1,442 ▲454.29 ▲0.0785.95 ▼17.9359.37 ▲15.80
基本设置 /wp-admin/admin.php?page=miniprogram1,4013.5450.8371.40
使用指南 /wp-admin/admin.php?page=guide1,1443.2741.1798.72
任务列表 /wp-admin/admin.php?page=task1,1393.3140.9050.15
订阅统计 /wp-admin/admin.php?page=subscribe1,0903.3241.7155.76

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • Zombie tables were found after uninstall: 2 tables
    • wp_applets_subscribe_message
    • wp_applets_subscribe_user
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
Please fix the following items
  • 4× 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/wp-mini-program/admin/core/menu.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-mini-program/admin/options.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-mini-program/wp-mini-program.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function options_nav_menu() in wp-content/plugins/wp-mini-program/admin/core/settings.php:10

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 96% 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
2 plugin tags: rest api, api

wp-mini-program/wp-mini-program.php 92% from 13 tests

"Mini Program API" version 1.4.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Description: The description should be shorter than 140 characters (currently 251 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
No dangerous file extensions were detected9,910 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
PHP331,1161818,736
JavaScript21524679
CSS1219495

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity59.53
▷ Minimum class complexity3.00
▷ Maximum class complexity173.00
Average method complexity7.62
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes15.88%
▷ Concrete classes1694.12%
▷ Final classes00.00%
Methods152
▷ Static methods117.24%
▷ Public methods13991.45%
▷ Protected methods138.55%
▷ Private methods00.00%
Functions129
▷ Named functions8263.57%
▷ Anonymous functions4736.43%
Constants3
▷ Global constants3100.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
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
logo.png19.41KB8.32KB▼ 57.13%