68% replicant

Code Review | Replicant

WordPress plugin Replicant scored68%from 54 tests.

About plugin

  • Plugin page: replicant
  • Plugin version: 0.7.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.8
  • WordPress version: 6.3.1
  • First release: Nov 4, 2021
  • Latest release: Nov 30, 2021
  • Number of updates: 14
  • Update frequency: every 2.0 days
  • Top authors: evokelektrique (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /356 total downloads

Benchmarks

Plugin footprint 65% 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.01MB] [CPU: ▼8.14ms] Passed 4 tests

A check of server-side resources used by Replicant
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0243.69 ▲0.64
Dashboard /wp-admin3.32 ▼0.0251.27 ▼16.09
Posts /wp-admin/edit.php3.44 ▲0.0852.73 ▼3.18
Add New Post /wp-admin/post-new.php5.92 ▲0.0387.37 ▼13.93
Media Library /wp-admin/upload.php3.25 ▲0.0238.93 ▲5.37
Replicant /wp-admin/admin.php?page=replicant-dashboard3.2435.14
Nodes /wp-admin/admin.php?page=replicant-nodes3.2937.17
Settings /wp-admin/admin.php?page=replicant-settings3.2535.57

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 1,288 new files
Database: 3 new tables, 7 new options
New tables
wp_replicant_logs
wp_replicant_nodes
wp_replicant_settings
New WordPress options
widget_recent-posts
can_compress_scripts
replicant_db_version
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Replicant
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲6914.41 ▲0.061.90 ▲0.0944.03 ▲4.03
Dashboard /wp-admin2,209 ▲355.66 ▲0.0592.70 ▼1.8676.05 ▲32.70
Posts /wp-admin/edit.php2,129 ▲291.99 ▼0.0334.95 ▼4.4733.53 ▼15.96
Add New Post /wp-admin/post-new.php1,571 ▲4518.30 ▼4.78676.36 ▼18.1558.74 ▲5.97
Media Library /wp-admin/upload.php1,429 ▲264.21 ▼0.1896.93 ▼3.5078.58 ▲35.80
Replicant /wp-admin/admin.php?page=replicant-dashboard7972.1326.1124.77
Nodes /wp-admin/admin.php?page=replicant-nodes9712.0124.8427.60
Settings /wp-admin/admin.php?page=replicant-settings8562.0024.6425.70

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The plugin did not uninstall successfully, leaving 3 tables in the database
    • wp_replicant_settings
    • wp_replicant_nodes
    • wp_replicant_logs
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • widget_recent-comments
    • replicant_db_version
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% 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 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
Please fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/replicant/trunk/vendor/htmlburger/carbon-fields/templates/Exception/incorrect-syntax.php
    • > /wp-content/plugins/replicant/vendor/htmlburger/carbon-fields/templates/Exception/incorrect-syntax.php
  • 336× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\File_Field' not found in wp-content/plugins/replicant/vendor/htmlburger/carbon-fields/core/Field/Image_Field.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/replicant/vendor/guzzlehttp/psr7/src/CachingStream.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Condition\\Comparer\\Comparer' not found in wp-content/plugins/replicant/trunk/vendor/htmlburger/carbon-fields/core/Container/Condition/Comparer/Contain_Comparer.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/replicant/vendor/guzzlehttp/promises/src/Coroutine.php:45
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Condition\\Comparer\\Comparer' not found in wp-content/plugins/replicant/vendor/htmlburger/carbon-fields/core/Container/Condition/Comparer/Any_Equality_Comparer.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Condition\\Condition' not found in wp-content/plugins/replicant/trunk/vendor/htmlburger/carbon-fields/core/Container/Condition/Post_Ancestor_ID_Condition.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Condition\\Condition' not found in wp-content/plugins/replicant/vendor/htmlburger/carbon-fields/core/Container/Condition/Post_Parent_ID_Condition.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/replicant/trunk/vendor/guzzlehttp/guzzle/src/Exception/TransferException.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/replicant/trunk/vendor/guzzlehttp/promises/src/FulfilledPromise.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/replicant/trunk/vendor/guzzlehttp/psr7/src/CachingStream.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% 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
These attributes need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === replicant === )
You can take inspiration from this readme.txt

replicant/replicant.php Passed 13 tests

The main PHP script in "Replicant" version 0.7.0 is automatically included on every request by WordPress
45 characters long description:
Synchronize your WordPress websites with ease

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected42,815 lines of code in 577 files:
LanguageFilesBlank linesComment linesLines of code
PHP2834,80812,61619,064
JavaScript1745,1948,46312,962
Markdown171,19203,582
PO File279251,1362,448
Sass4937291,925
CSS83251,1391,663
JSON15001,127
XML10028
make1409
YAML1007
Bourne Shell1010

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity9.90
▷ Minimum class complexity1.00
▷ Maximum class complexity88.00
Average method complexity2.32
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces38
Interfaces62
Traits12
Classes430
▷ Abstract classes225.12%
▷ Concrete classes40894.88%
▷ Final classes7217.65%
Methods3,386
▷ Static methods49214.53%
▷ Public methods2,79682.58%
▷ Protected methods3389.98%
▷ Private methods2527.44%
Functions450
▷ Named functions10623.56%
▷ Anonymous functions34476.44%
Constants182
▷ Global constants105.49%
▷ Class constants17294.51%
▷ Public constants15087.21%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
8 PNG files occupy 0.25MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
resources/icon_16x16.png2.10KB0.51KB▼ 75.65%
replicant.png60.18KB36.65KB▼ 39.10%
trunk/replicant.png60.18KB36.65KB▼ 39.10%
resources/icon_big.png61.75KB42.69KB▼ 30.87%
trunk/resources/icon_big.png61.75KB42.69KB▼ 30.87%