84% advanced-custom-fields-markdown

Code Review | Advanced Custom Fields: Markdown Field

WordPress plugin Advanced Custom Fields: Markdown Field scored84%from 54 tests.

About plugin

  • Plugin page: advanced-custom-f...
  • Plugin version: 1.1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.6.1
  • WordPress version: 6.3.1
  • First release: Oct 20, 2014
  • Latest release: Oct 9, 2016
  • Number of updates: 10
  • Update frequency: every 72.0 days
  • Top authors: jensnilsson (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /4,804 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

Server-side resources used by Advanced Custom Fields: Markdown Field
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.21 ▼5.79
Dashboard /wp-admin3.31 ▲0.0144.60 ▼6.75
Posts /wp-admin/edit.php3.36 ▲0.0044.27 ▼0.62
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.99 ▼2.98
Media Library /wp-admin/upload.php3.24 ▲0.0036.13 ▲2.12

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 78 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Advanced Custom Fields: Markdown Field
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9013.16 ▼1.491.93 ▼0.4638.34 ▼10.24
Dashboard /wp-admin2,209 ▲214.86 ▼0.95110.58 ▲8.9941.24 ▼2.55
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0138.88 ▲3.0534.64 ▼0.71
Add New Post /wp-admin/post-new.php1,533 ▲1423.49 ▲0.26666.78 ▼49.1558.30 ▲0.53
Media Library /wp-admin/upload.php1,388 ▲34.21 ▲0.04123.89 ▲15.4151.38 ▲4.25

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded

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
Everything seems fine, however this is by no means an exhaustive test

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 take a closer look at the following
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/advanced-custom-fields-markdown/acf-markdown-v4.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/advanced-custom-fields-markdown/acf-markdown-v5.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/advanced-custom-fields-markdown/acf-markdown.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

advanced-custom-fields-markdown/acf-markdown.php 92% from 13 tests

This is the main PHP file of "Advanced Custom Fields: Markdown Field" version 1.1.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("advanced-custom-fields-markdown.php" instead of "acf-markdown.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 detected8,552 lines of code in 72 files:
LanguageFilesBlank linesComment linesLines of code
CSS567494385,170
JavaScript44236002,009
Markdown83630885
PHP3267587480
Stylus1008

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.05
Average class complexity3.50
▷ Minimum class complexity3.00
▷ Maximum class complexity4.00
Average method complexity1.29
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods17
▷ Static methods00.00%
▷ Public methods17100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
js/lib/highlight/styles/brown_papersq.png17.77KB9.92KB▼ 44.16%
js/lib/highlight/styles/school_book.png0.47KB0.34KB▼ 27.37%