78% jiutu-mapmarker

Code Review | 一款精美的在线 旅行地图标记,记录日志插件

WordPress plugin 一款精美的在线 旅行地图标记,记录日志插件 scored78%from 54 tests.

About plugin

  • Plugin page: jiutu-mapmarker
  • Plugin version: 1.2.7
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.1
  • WordPress version: 6.3.1
  • First release: Apr 6, 2022
  • Latest release: Mar 20, 2023
  • Number of updates: 37
  • Update frequency: every 9.4 days
  • Top authors: jiutu (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /630 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: ▲1.00MB] [CPU: ▼3.21ms] Passed 4 tests

Server-side resources used by 一款精美的在线 旅行地图标记,记录日志插件
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.80 ▲1.0749.57 ▲3.92
Dashboard /wp-admin4.63 ▲1.0058.49 ▼8.40
Posts /wp-admin/edit.php4.68 ▲1.0064.26 ▲6.44
Add New Post /wp-admin/post-new.php7.15 ▲1.0098.67 ▼14.80
Media Library /wp-admin/upload.php4.49 ▲1.0050.75 ▲11.68

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for 一款精美的在线 旅行地图标记,记录日志插件
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,923 ▲16218.66 ▲4.0611.58 ▲9.3342.82 ▲3.56
Dashboard /wp-admin2,253 ▲738.16 ▲2.56109.92 ▲19.9949.57 ▲3.89
Posts /wp-admin/edit.php2,161 ▲584.96 ▲2.9655.88 ▲14.6544.80 ▲6.00
Add New Post /wp-admin/post-new.php1,572 ▲4122.72 ▼0.40675.34 ▲52.7143.64 ▼16.09
Media Library /wp-admin/upload.php1,458 ▲617.65 ▲3.38110.85 ▲1.6147.76 ▲1.15
使用说明 /wp-admin/admin.php?page=jiutu_mapmarker#tab=%e4%bd%bf%e7%94%a8%e8%af%b4%e6%98%8e1,9608.0599.07158.57
我的足迹 /wp-admin/admin.php?page=jiutu_mapmarker#tab=%e6%88%91%e7%9a%84%e8%b6%b3%e8%bf%b91,9438.37154.0548.12
地图设置 /wp-admin/admin.php?page=jiutu_mapmarker#tab=%e5%9c%b0%e5%9b%be%e8%ae%be%e7%bd%ae2,86512.74230.24188.10

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • jiutu_mapmarker_data
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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
Please take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/jiutu-mapmarker/mapmarker.php:13

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=jiutu_mapmarker#tab=%e4%bd%bf%e7%94%a8%e8%af%b4%e6%98%8e
    • > Network (severe)
    wp-content/plugins/jiutu-mapmarker/static/about-header-about.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
Please fix the following attributes:
  • Screenshots: These screenshots do not have images: #1 (`前台展示图片`), #2 (`地点日志时间详情`), #3 (`插件配置截图`)
The official readme.txt is a good inspiration

jiutu-mapmarker/mapmarker.php 92% from 13 tests

The main PHP file in "一款精美的在线 旅行地图标记,记录日志插件" ver. 1.2.7 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("jiutu-mapmarker.php" instead of "mapmarker.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected13,080 lines of code in 70 files:
LanguageFilesBlank linesComment linesLines of code
PHP591,5668066,151
CSS395745,269
JavaScript558491,324
PO File1161177334
SVG2002

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.64
Average class complexity20.90
▷ Minimum class complexity1.00
▷ Maximum class complexity150.00
Average method complexity6.88
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes52
▷ Abstract classes23.85%
▷ Concrete classes5096.15%
▷ Final classes00.00%
Methods176
▷ Static methods2815.91%
▷ Public methods176100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions29
▷ Named functions2586.21%
▷ Anonymous functions413.79%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
11 PNG files occupy 1.98MB with 0.30MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
static/css/images/map/dark.png221.83KB238.85KB0.00%
static/css/images/layers.png0.68KB1.05KB0.00%
screenshot-3.png67.89KB16.84KB▼ 75.20%
static/css/images/map/streets.png236.88KB251.86KB0.00%
inc/assets/images/checkerboard.png2.29KB2.54KB0.00%