84% civil-right-defenders-didi

Code Review | Civil Right Defenders - DIDI

WordPress plugin Civil Right Defenders - DIDI scored84%from 54 tests.

About plugin

  • Plugin page: civil-right-defen...
  • Plugin version: 1.0.5
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.3
  • WordPress version: 6.3.1
  • First release: Feb 11, 2019
  • Latest release: Nov 26, 2020
  • Number of updates: 13
  • Update frequency: every 50.6 days
  • Top authors: caagsoftware (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /689 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.11MB] [CPU: ▼4.39ms] Passed 4 tests

Server-side resources used by Civil Right Defenders - DIDI
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1237.30 ▼3.52
Dashboard /wp-admin3.42 ▲0.1143.97 ▼6.23
Posts /wp-admin/edit.php3.53 ▲0.1749.74 ▼1.21
Add New Post /wp-admin/post-new.php6.00 ▲0.1195.54 ▼6.28
Media Library /wp-admin/upload.php3.34 ▲0.1137.58 ▼1.51
DiDi – Settings /wp-admin/options-general.php?page=hq-crd-settings3.3134.83

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Civil Right Defenders - DIDI
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲8113.23 ▼1.041.73 ▼0.1441.14 ▼32.25
Dashboard /wp-admin2,219 ▲345.86 ▼0.15110.77 ▼17.4842.96 ▼2.01
Posts /wp-admin/edit.php2,102 ▲132.03 ▼0.0241.01 ▲1.1234.47 ▼3.66
Add New Post /wp-admin/post-new.php1,551 ▲1723.23 ▼0.19603.67 ▼58.6159.16 ▲9.36
Media Library /wp-admin/upload.php1,404 ▲224.22 ▲0.0198.69 ▼1.0044.52 ▲0.14
DiDi – Settings /wp-admin/options-general.php?page=hq-crd-settings8632.0226.6528.78

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/civil-right-defenders-didi/includes/views/settings.php:25

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

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
2 plugin tags: hq, crd

civil-right-defenders-didi/hq-crd.php 92% from 13 tests

The main file in "Civil Right Defenders - DIDI" v. 1.0.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("civil-right-defenders-didi.php" instead of "hq-crd.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected558 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP169167530
XML40027
Markdown1001

PHP code Passed 2 tests

Analyzing 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.23
Average class complexity2.69
▷ Minimum class complexity1.00
▷ Maximum class complexity7.00
Average method complexity1.56
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces9
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods39
▷ Static methods00.00%
▷ Public methods39100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
3 PNG files occupy 0.12MB with 0.05MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png42.77KB21.10KB▼ 50.67%
assets/icon-256x256.png4.99KB3.38KB▼ 32.18%
assets/screenshot-1.png74.38KB40.49KB▼ 45.56%