84% traum-toutiao

Code Review | 新浪微博头条

WordPress plugin 新浪微博头条 scored84%from 54 tests.

About plugin

  • Plugin page: traum-toutiao
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.3
  • WordPress version: 6.3.1
  • First release: Jun 22, 2019
  • Latest release: Dec 11, 2019
  • Number of updates: 7
  • Update frequency: every 24.7 days
  • Top authors: jysafe (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /532 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

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

This is a short check of server-side resources used by 新浪微博头条
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.35 ▼6.42
Dashboard /wp-admin3.32 ▲0.0248.27 ▲0.07
Posts /wp-admin/edit.php3.37 ▲0.0244.00 ▼4.35
Add New Post /wp-admin/post-new.php5.90 ▲0.0285.82 ▼3.49
Media Library /wp-admin/upload.php3.25 ▲0.0238.85 ▲5.88

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, 12 new options
New WordPress options
db_upgraded
widget_recent-comments
traum_toutiao_setting_cover
traum_toutiao_setting_password
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
traum_toutiao_setting_appkey
traum_toutiao_setting_check_box_enble
traum_toutiao_setting_log_enble
...

Browser metrics Passed 4 tests

Checking browser requirements for 新浪微博头条
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲6913.28 ▼1.091.71 ▼0.1141.12 ▼7.10
Dashboard /wp-admin2,221 ▲295.86 ▲0.97102.84 ▼8.8074.26 ▲31.79
Posts /wp-admin/edit.php2,107 ▲142.01 ▲0.0133.64 ▼2.6237.02 ▲3.73
Add New Post /wp-admin/post-new.php1,681 ▲13522.01 ▼1.28761.77 ▲94.7555.50 ▼26.76
Media Library /wp-admin/upload.php1,394 ▲64.23 ▲0.0699.23 ▼3.2886.22 ▲41.63

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • 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 everything seems fine, this is not an exhaustive test

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
Please fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/traum-toutiao/functions.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/traum-toutiao/options.php:15

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 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: toutiao, sina toutiao, sina

traum-toutiao/functions.php 92% from 13 tests

The entry point to "新浪微博头条" version 1.0.2 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("traum-toutiao.php" instead of "functions.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin328 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP33998328

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected