78% darkmode-ga

Code Review | GAPlugin - DarkMode

WordPress plugin GAPlugin - DarkMode scored78%from 54 tests.

About plugin

  • Plugin page: darkmode-ga
  • Plugin version:
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.6
  • WordPress version: 6.3.1
  • First release: May 20, 2020
  • Latest release: Feb 6, 2021
  • Number of updates: 6
  • Update frequency: every 43.7 days
  • Top authors: gautierantoine (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /690 total downloads


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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.07MB] [CPU: ▼3.99ms] Passed 4 tests

Analyzing server-side resources used by GAPlugin - DarkMode
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0744.34 ▲3.47
Dashboard /wp-admin3.38 ▲0.0750.24 ▼2.41
Posts /wp-admin/edit.php3.49 ▲0.1349.08 ▼0.49
Add New Post /wp-admin/post-new.php5.96 ▲0.0793.22 ▼16.51
Media Library /wp-admin/upload.php3.30 ▲0.0743.62 ▲10.04
Darkmode /wp-admin/admin.php?page=gap-admin-page-darkmode3.2632.21
GAPlugin /wp-admin/admin.php?page=gap-admin-page3.2634.35

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options

Browser metrics Passed 4 tests

This is an overview of browser requirements for GAPlugin - DarkMode
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲7814.27 ▼0.022.41 ▲0.8842.65 ▲1.77
Dashboard /wp-admin2,226 ▲525.84 ▲0.3083.66 ▼5.5273.10 ▲27.46
Posts /wp-admin/edit.php2,134 ▲341.99 ▼0.0237.68 ▲1.6331.98 ▼2.26
Add New Post /wp-admin/post-new.php1,708 ▲16821.83 ▲3.54740.59 ▲75.5860.67 ▼18.68
Media Library /wp-admin/upload.php1,434 ▲344.15 ▼0.05100.85 ▼5.1076.89 ▲33.84
Darkmode /wp-admin/admin.php?page=gap-admin-page-darkmode8312.0326.3729.32
GAPlugin /wp-admin/admin.php?page=gap-admin-page8201.9929.1129.07

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

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

SRP 0% 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 fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/darkmode-ga/gaplugin-darkmode-plugin.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'GAPlugin\\AdminPage' not found in wp-content/plugins/darkmode-ga/includes/DarkMode.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected


Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: dark, darkmode, light, navigation, colors

darkmode-ga/gaplugin-darkmode-plugin.php 85% from 13 tests

The entry point to "GAPlugin - DarkMode" version is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("darkmode-ga.php" instead of "gaplugin-darkmode-plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin404 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PO File1172343

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity4.00
▷ Minimum class complexity3.00
▷ Maximum class complexity5.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
▷ Static methods24100.00%
▷ Public methods24100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions00.00%
▷ Anonymous functions2100.00%
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin