94% advanced-custom-fields-markdown

Code Review | Advanced Custom Fields: Markdown Field

WordPress plugin Advanced Custom Fields: Markdown Field scored 94% 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: 5.9.2
  • 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,495 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

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

Analyzing server-side resources used by Advanced Custom Fields: Markdown Field
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0152.32 ▲4.05
Dashboard /wp-admin3.41 ▲0.0132.97 ▼1.13
Posts /wp-admin/edit.php3.65 ▲0.0137.89 ▲0.91
Add New Post /wp-admin/post-new.php6.88 ▼0.0988.87 ▼1,170.60
Media Library /wp-admin/upload.php3.30 ▲0.0025.18 ▲2.80

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 78 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Advanced Custom Fields: Markdown Field: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,763 ▲1915.89 ▲0.276.29 ▼0.192.36 ▲0.26
Dashboard /wp-admin2,888 ▲276.10 ▼0.17116.94 ▼18.74152.19 ▼10.74
Posts /wp-admin/edit.php2,691 ▼03.23 ▼0.0063.08 ▼1.46140.40 ▼1.35
Add New Post /wp-admin/post-new.php1,760 ▲9917.47 ▲1.27428.99 ▲7.84157.53 ▲3.09
Media Library /wp-admin/upload.php1,695 ▼35.50 ▲0.01163.55 ▲27.22197.47 ▲11.58

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, 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
The following issues need your attention
  • 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-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
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/advanced-custom-fields-markdown/acf-markdown-v4.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

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

The entry point to "Advanced Custom Fields: Markdown Field" version 1.1.4 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to 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 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin8,552 lines of code in 72 files:
LanguageFilesBlank linesComment linesLines of code
CSS567494385,170
JavaScript44236002,009
Markdown83630885
PHP3267587480
Stylus1008

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
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

Using a strong compression for your PNG files is a great way to speed-up your plugin
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/school_book.png0.47KB0.34KB▼ 27.37%
js/lib/highlight/styles/brown_papersq.png17.77KB9.92KB▼ 44.16%