68% real-time-comments-with-pusher

Code Review | Real Time Comments With Pusher

WordPress plugin Real Time Comments With Pusher scored 68% from 54 tests.

About plugin

  • Plugin page: real-time-comment...
  • Plugin version: 1.1.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8
  • WordPress version: 6.3.1
  • First release: Dec 10, 2021
  • Latest release: Jan 5, 2022
  • Number of updates: 13
  • Update frequency: every 2.2 days
  • Top authors: gepopp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 347 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.02MB] [CPU: ▲3.46ms] Passed 4 tests

Server-side resources used by Real Time Comments With Pusher
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.48 ▲1.0246.43 ▲9.65
Dashboard /wp-admin4.33 ▲1.0249.77 ▲0.77
Posts /wp-admin/edit.php4.38 ▲1.0255.29 ▲10.75
Add New Post /wp-admin/post-new.php6.95 ▲1.0788.53 ▼6.64
Media Library /wp-admin/upload.php4.25 ▲1.0243.31 ▲10.05

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 1,681 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
rtc_general_settings
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Real Time Comments With Pusher: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲8113.22 ▼1.081.71 ▲0.1444.93 ▲3.09
Dashboard /wp-admin2,225 ▲375.88 ▼0.02104.51 ▼7.3039.15 ▼8.11
Posts /wp-admin/edit.php2,108 ▲192.04 ▲0.0039.25 ▲5.6136.45 ▲2.13
Add New Post /wp-admin/post-new.php1,547 ▲1123.00 ▼0.24687.01 ▲40.8255.36 ▼9.09
Media Library /wp-admin/upload.php1,404 ▲194.23 ▲0.0497.39 ▼4.8741.96 ▼3.22

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • rtc_general_settings
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
Almost there! Just fix the following items
  • 17× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/real-time-comments-with-pusher/vendor/predis/predis/examples/replication_sentinel.php
    • > /wp-content/plugins/real-time-comments-with-pusher/vendor/symfony/translation/Resources/bin/translation-status.php
    • > /wp-content/plugins/real-time-comments-with-pusher/vendor/predis/predis/examples/replication_simple.php
    • > /wp-content/plugins/real-time-comments-with-pusher/vendor/predis/predis/examples/pipelining_commands.php
    • > /wp-content/plugins/real-time-comments-with-pusher/vendor/predis/predis/examples/dispatcher_loop.php
    • > /wp-content/plugins/real-time-comments-with-pusher/vendor/predis/predis/examples/redis_collections_iterators.php
    • > /wp-content/plugins/real-time-comments-with-pusher/vendor/predis/predis/examples/session_handler.php
    • > /wp-content/plugins/real-time-comments-with-pusher/vendor/predis/predis/examples/monitor_consumer.php
    • > /wp-content/plugins/real-time-comments-with-pusher/vendor/predis/predis/examples/key_prefixing.php
    • > /wp-content/plugins/real-time-comments-with-pusher/vendor/predis/predis/examples/pubsub_consumer.php
  • 577× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\ZSetRange' not found in wp-content/plugins/real-time-comments-with-pusher/vendor/predis/predis/src/Command/ZSetReverseRange.php:19
    • > PHP Notice
      Constant SODIUM_CRYPTO_KX_SEEDBYTES already defined in wp-content/plugins/real-time-comments-with-pusher/vendor/paragonie/sodium_compat/lib/php72compat_const.php on line 42
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\Command' not found in wp-content/plugins/real-time-comments-with-pusher/vendor/predis/predis/src/Command/GeospatialGeoPos.php:19
    • > PHP Notice
      Constant SODIUM_CRYPTO_SECRETBOX_KEYBYTES already defined in wp-content/plugins/real-time-comments-with-pusher/vendor/paragonie/sodium_compat/lib/php72compat_const.php on line 73
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Translation\\Exception\\InvalidArgumentException' not found in wp-content/plugins/real-time-comments-with-pusher/vendor/symfony/translation/Exception/IncompleteDsnException.php:14
    • > PHP Fatal error
      Trait 'Carbon\\Traits\\Boundaries' not found in wp-content/plugins/real-time-comments-with-pusher/vendor/nesbot/carbon/src/Carbon/Traits/Date.php on line 527
    • > PHP Notice
      Constant SODIUM_LIBRARY_MINOR_VERSION already defined in wp-content/plugins/real-time-comments-with-pusher/vendor/paragonie/sodium_compat/lib/php72compat_const.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\PredisException' not found in wp-content/plugins/real-time-comments-with-pusher/vendor/predis/predis/src/Response/ServerException.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Collection\\Iterator\\CursorBasedIterator' not found in wp-content/plugins/real-time-comments-with-pusher/vendor/predis/predis/src/Collection/Iterator/SortedSetKey.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\Command' not found in wp-content/plugins/real-time-comments-with-pusher/vendor/predis/predis/src/Command/ZSetUnionStore.php:19

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
9 plugin tags: avatar, plugin, commentform, comments, realtime...

real-time-comments-with-pusher/real-time-comments.php 85% from 13 tests

The main file in "Real Time Comments With Pusher" v. 1.1.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("real-time-comments-with-pusher.php" instead of "real-time-comments.php")

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
It is important to fix the following items
  • For security reasons, never distribute binary or executable files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/real-time-comments-with-pusher/vendor/bin/carbon.bat
      • wp-content/plugins/real-time-comments-with-pusher/vendor/nesbot/carbon/bin/carbon.bat
89,867 lines of code in 1,449 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,35514,91850,61077,030
Markdown322,04805,724
XSD392482,803
JSON26002,630
JavaScript9427728895
PO File292178238
SVG131162
YAML4210114
diff4868111
XML4144279
make213435
INI16624
Bourne Shell2418
DOS Batch2008
CSS2006

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
It is recommended to fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 140)
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity9.94
▷ Minimum class complexity1.00
▷ Maximum class complexity380.00
Average method complexity2.65
▷ Minimum method complexity1.00
▷ Maximum method complexity140.00
Code structure
Namespaces73
Interfaces80
Traits31
Classes559
▷ Abstract classes407.16%
▷ Concrete classes51992.84%
▷ Final classes489.25%
Methods4,037
▷ Static methods1,04525.89%
▷ Public methods3,42084.72%
▷ Protected methods3578.84%
▷ Private methods2606.44%
Functions590
▷ Named functions26044.07%
▷ Anonymous functions33055.93%
Constants530
▷ Global constants213.96%
▷ Class constants50996.04%
▷ Public constants49597.25%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
dist/images/logo-full_300.png15.15KB6.30KB▼ 58.42%
dist/images/emoji2.png38.17KB38.13KB0.11%