78% dark-mode

Code Review | WP Markdown Editor (Formerly Dark Mode)

WordPress plugin WP Markdown Editor (Formerly Dark Mode) scored 78% from 54 tests.

About plugin

  • Plugin page: dark-mode
  • Plugin version: 4.1.1.
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-5.7
  • WordPress version: 5.8.1
  • First release: Oct 10, 2017
  • Latest release: Sep 2, 2021
  • Number of updates: 64
  • Update frequency: every 22.3 days
  • Top authors: danieltj (50%)wppool (31.25%)princeahmed (7.81%)emrikol (7.81%)azizultex (6.25%)

Code review

54 tests

User reviews

62 reviews

Install metrics

3,000+ active / 86,678 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.40MB] [CPU: ▼132.42ms] Passed 4 tests

This is a short check of server-side resources used by WP Markdown Editor (Formerly Dark Mode)
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.16 ▲0.4440.76 ▲20.68
Dashboard /wp-admin3.50 ▲0.4563.29 ▲15.27
Posts /wp-admin/edit.php3.55 ▲0.4456.35 ▲18.19
Add New Post /wp-admin/post-new.php5.78 ▲0.35105.85 ▼554.73
Media Library /wp-admin/upload.php3.36 ▲0.3537.06 ▼8.39
WP Markdown Editor /wp-admin/options-general.php?page=wp-markdown-settings3.3748.99

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 36 new files
Database: no new tables, 4 new options
New WordPress options
dark_mode_install_time
wpmde_general
wp_markdown_editor_update_notice_interval
dark_mode_version

Browser metrics Passed 4 tests

Checking browser requirements for WP Markdown Editor (Formerly Dark Mode)
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,998 ▲40217.72 ▲1.768.19 ▼1.9151.74 ▲1.99
Dashboard /wp-admin3,309 ▲3758.20 ▲2.14181.38 ▲32.54115.84 ▲1.41
Posts /wp-admin/edit.php3,074 ▲3354.57 ▲1.8993.68 ▲25.3598.17 ▲4.63
Add New Post /wp-admin/post-new.php1,762 ▲15818.36 ▼0.45372.53 ▼2.97114.47 ▼8.29
Media Library /wp-admin/upload.php1,840 ▲334.92 ▼0.10129.00 ▼33.75126.02 ▼2.07
WP Markdown Editor /wp-admin/options-general.php?page=wp-markdown-settings1,9414.4493.64118.54

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
  • This plugin did not uninstall successfully, leaving 4 options in the database
    • dark_mode_install_time
    • wpmde_general
    • dark_mode_version
    • wp_markdown_editor_update_notice_interval

Smoke tests 50% 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 no errors were found, this is by no means an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/dark-mode/includes/notices/affiliate-notice.php
    • > /wp-content/plugins/dark-mode/includes/notices/review-notice.php
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_transient() in wp-content/plugins/dark-mode/includes/promo.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dark-mode/includes/class-settings.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: editor, dashboard, markdown editor, dark, markdown

dark-mode/dark-mode.php 92% from 13 tests

The entry point to "WP Markdown Editor (Formerly Dark Mode)" version 4.1.1. is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Version: Use periods and digits only for your plugin's version number (ex. "1.0.3" instead of "4.1.1.")

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
Everything looks great! No dangerous files found in this plugin3,210 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP177529852,821
SVG500165
CSS2134104
JavaScript3231154
Markdown213045
JSON10021

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity23.92
▷ Minimum class complexity3.00
▷ Maximum class complexity74.00
Average method complexity2.61
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes18.33%
Methods159
▷ Static methods95.66%
▷ Public methods12377.36%
▷ Protected methods63.77%
▷ Private methods3018.87%
Functions9
▷ Named functions777.78%
▷ Anonymous functions222.22%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/timer.png2.39KB2.37KB▼ 0.98%