84% wp-baidu-map

Code Review | WP Baidu Map

WordPress plugin WP Baidu Map scored84%from 54 tests.

About plugin

  • Plugin page: wp-baidu-map
  • Plugin version: 1.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.6
  • WordPress version: 6.3.1
  • First release: Jul 24, 2014
  • Latest release: Aug 27, 2018
  • Number of updates: 46
  • Update frequency: every 32.5 days
  • Top authors: suifengtec (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

1,000+ active /38,935 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼3.38ms] Passed 4 tests

Analyzing server-side resources used by WP Baidu Map
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.81 ▼0.28
Dashboard /wp-admin3.31 ▲0.0144.72 ▼6.75
Posts /wp-admin/edit.php3.36 ▲0.0145.63 ▼4.01
Add New Post /wp-admin/post-new.php5.89 ▲0.0192.93 ▲5.29
Media Library /wp-admin/upload.php3.23 ▲0.0132.00 ▼2.46

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for WP Baidu Map
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9013.21 ▼1.591.93 ▼0.0643.81 ▼2.92
Dashboard /wp-admin2,209 ▲214.85 ▼0.09107.68 ▼13.2537.59 ▼7.61
Posts /wp-admin/edit.php2,089 ▼02.06 ▲0.0140.75 ▲6.9535.52 ▼1.07
Add New Post /wp-admin/post-new.php1,377 ▼15618.93 ▼4.59536.67 ▼149.9659.57 ▲10.69
Media Library /wp-admin/upload.php1,391 ▲64.19 ▼0.0499.76 ▼3.0741.13 ▼6.38

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wp-baidu-map/views/modal.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
2 plugin tags: baidu, map

wp-baidu-map/wp-baidu-map.php Passed 13 tests

"WP Baidu Map" version 1.2.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
24 characters long description:
A real Baidu map plugin.

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
Everything looks great! No dangerous files found in this plugin217 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP22619133
JavaScript261282
CSS1001
SVG1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity23.00
▷ Minimum class complexity23.00
▷ Maximum class complexity23.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods545.45%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
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
imgs/btn.png18.58KB7.75KB▼ 58.31%