68% wp-vk

Code Review | WP VK-付费内容插件(付费阅读/资料/工具软件资源管理)

WordPress plugin WP VK-付费内容插件(付费阅读/资料/工具软件资源管理) scored68%from 54 tests.

About plugin

  • Plugin page: wp-vk
  • Plugin version: 1.3.5
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.3
  • WordPress version: 6.3.1
  • First release: Jun 16, 2020
  • Latest release: Sep 14, 2023
  • Number of updates: 21
  • Update frequency: every 64.0 days
  • Top authors: wbolt (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /9,046 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: ▲0.02MB] [CPU: ▼9.26ms] Passed 4 tests

This is a short check of server-side resources used by WP VK-付费内容插件(付费阅读/资料/工具软件资源管理)
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0737.53 ▼4.74
Dashboard /wp-admin3.33 ▼0.0145.63 ▼13.29
Posts /wp-admin/edit.php3.39 ▲0.0346.73 ▼6.31
Add New Post /wp-admin/post-new.php5.93 ▲0.0581.16 ▼12.70
Media Library /wp-admin/upload.php3.26 ▲0.0338.81 ▲4.68

Server storage [IO: ▲2.08MB] [DB: ▲0.07MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 90 new files
Database: 2 new tables, 7 new options
New tables
wp_vk_trade_log
wp_vk_orders
New WordPress options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_recent-posts
widget_wb_wp_vk_widget
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

WP VK-付费内容插件(付费阅读/资料/工具软件资源管理): an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲6314.35 ▼0.021.70 ▼0.0839.22 ▼3.55
Dashboard /wp-admin2,227 ▲475.51 ▼0.1486.62 ▲1.5544.15 ▲3.08
Posts /wp-admin/edit.php2,132 ▲291.99 ▲0.0239.29 ▼1.7344.24 ▲8.60
Add New Post /wp-admin/post-new.php6,392 ▲4,86427.69 ▲4.49888.31 ▲247.4956.14 ▲7.24
Media Library /wp-admin/upload.php1,438 ▲384.24 ▼0.04109.68 ▲11.6454.33 ▲13.53
订单管理 /wp-admin/admin.php?page=wp_vk#/order1,2867.23101.89109.29
支付设置 /wp-admin/admin.php?page=wp_vk#/pay-setting1,2917.2992.4773.95
插件设置 /wp-admin/admin.php?page=wp_vk#/setting1,2967.3187.7563.46
资源管理 /wp-admin/admin.php?page=wp_vk#/items1,2917.2586.9263.63

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie tables were found after uninstall: 2 tables
    • wp_vk_trade_log
    • wp_vk_orders
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • widget_wb_wp_vk_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, 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
Please take a closer look at the following
  • 8× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-vk/tpl/wbs_header.tpl.php
    • > /wp-content/plugins/wp-vk/pay/hupay/notify.php
    • > /wp-content/plugins/wp-vk/pay/alipay/return.php
    • > /wp-content/plugins/wp-vk/tpl/my_order.tpl.php
    • > /wp-content/plugins/wp-vk/tpl/wbs_admin.tpl.php
    • > /wp-content/plugins/wp-vk/pay/payjs/notify.php
    • > /wp-content/plugins/wp-vk/order/my_order.tpl.php
    • > /wp-content/plugins/wp-vk/wbm/tpl/svg.php
  • 33× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined index: data in wp-content/plugins/wp-vk/pay/wxpay/qrcode.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/wp-vk/index.php:15
    • > PHP Notice
      Undefined variable: list in wp-content/plugins/wp-vk/tpl/my_order.tpl.php on line 7
    • > PHP Notice
      Undefined variable: user_id in wp-content/plugins/wp-vk/tpl/front_tips_content.php on line 8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-vk/tpl/front_tips_content.php on line 13
    • > PHP Notice
      Undefined variable: pd_index_url in wp-content/plugins/wp-vk/tpl/wbs_header.tpl.php on line 12
    • > PHP Notice
      Undefined variable: pages in wp-content/plugins/wp-vk/order/my_order.tpl.php on line 53
    • > PHP Notice
      Undefined variable: title in wp-content/plugins/wp-vk/tpl/front_widget.php on line 57
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/wp-vk/wbm/tpl/header.php:12
    • > PHP Warning
      Use of undefined constant WP_VK_PATH - assumed 'WP_VK_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-vk/order/my_order.tpl.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: payjs, wechat pay, xunhupay, alipay

wp-vk/index.php 85% from 13 tests

"WP VK-付费内容插件(付费阅读/资料/工具软件资源管理)" version 1.3.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-vk.php" instead of "index.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 253 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
No dangerous file extensions were detected9,527 lines of code in 77 files:
LanguageFilesBlank linesComment linesLines of code
PHP482,3772,9259,448
SQL110144
JavaScript1805724
CSS100911

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity24.33
▷ Minimum class complexity1.00
▷ Maximum class complexity246.00
Average method complexity2.74
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes54
▷ Abstract classes11.85%
▷ Concrete classes5398.15%
▷ Final classes00.00%
Methods716
▷ Static methods25535.61%
▷ Public methods70798.74%
▷ Protected methods00.00%
▷ Private methods91.26%
Functions13
▷ Named functions17.69%
▷ Anonymous functions1292.31%
Constants40
▷ Global constants40100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.11MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/wxp_pic.png56.87KB57.03KB0.00%
assets/pagebreak.png2.59KB2.59KB0.00%
assets/img/alipay-pic.png48.80KB16.73KB▼ 65.71%