78% toolstruthsocial

Code Review | WordPress Tools and feeds for Truth Social (TruthSocial) media and Twitter Plugin

WordPress plugin WordPress Tools and feeds for Truth Social (TruthSocial) media and Twitter Plugin scored78%from 54 tests.

About plugin

  • Plugin page: toolstruthsocial
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.4
  • WordPress version: 6.3.1
  • First release: Nov 3, 2021
  • Latest release: Nov 4, 2023
  • Number of updates: 51
  • Update frequency: every 14.6 days
  • Top authors: sminozzi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /2,501 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼1.44ms] Passed 4 tests

Server-side resources used by WordPress Tools and feeds for Truth Social (TruthSocial) media and Twitter Plugin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0336.73 ▼2.92
Dashboard /wp-admin3.34 ▲0.0445.82 ▼2.97
Posts /wp-admin/edit.php3.45 ▲0.1049.09 ▲0.32
Add New Post /wp-admin/post-new.php5.92 ▲0.0493.30 ▲1.85
Media Library /wp-admin/upload.php3.27 ▲0.0434.91 ▼0.20

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

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

Browser metrics Passed 4 tests

WordPress Tools and feeds for Truth Social (TruthSocial) media and Twitter Plugin: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,963 ▲20114.04 ▲0.1533.88 ▲32.2339.77 ▼6.58
Dashboard /wp-admin2,229 ▲495.65 ▲0.0093.71 ▼5.9143.41 ▼1.85
Posts /wp-admin/edit.php2,131 ▲311.94 ▼0.0739.98 ▲1.2635.78 ▼0.13
Add New Post /wp-admin/post-new.php1,557 ▲3125.32 ▲2.19599.76 ▼90.0668.17 ▲14.09
Media Library /wp-admin/upload.php1,425 ▲254.21 ▼0.0296.06 ▼11.4743.28 ▲0.51

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
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • bill_show_warnings
    • 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
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/toolstruthsocial/truthsocial.php
    • > /wp-content/plugins/toolstruthsocial/includes/checkup/bill_class_diagnose.php
    • > /wp-content/plugins/toolstruthsocial/includes/checkup/class_bill_catch_errors.php
  • 10× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Abraham\\TwitterOAuth\\Config' not found in wp-content/plugins/toolstruthsocial/vendor/abraham/twitteroauth/src/TwitterOAuth.php:16
    • > PHP Warning
      require(wp-content/plugins/toolstruthsocial/vendor/abraham/twitteroauth/tests/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/toolstruthsocial/vendor/abraham/twitteroauth/tests/bootstrap.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/toolstruthsocial/vendor/abraham/twitteroauth/tests/TwitterOAuthTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/toolstruthsocial/vendor/abraham/twitteroauth/tests/ConsumerTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/toolstruthsocial/vendor/abraham/twitteroauth/tests/AbstractSignatureMethodTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Abraham\\TwitterOAuth\\SignatureMethod' not found in wp-content/plugins/toolstruthsocial/vendor/abraham/twitteroauth/src/HmacSha1.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Abraham\\TwitterOAuth\\Tests\\AbstractSignatureMethodTest' not found in wp-content/plugins/toolstruthsocial/vendor/abraham/twitteroauth/tests/HmacSha1Test.php:7
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/toolstruthsocial/vendor/abraham/twitteroauth/tests/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/toolstruthsocial/vendor/abraham/twitteroauth/tests/bootstrap.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/toolstruthsocial/vendor/abraham/twitteroauth/tests/TokenTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'ToolsTruthSocialWPSettings\\Page' not found in wp-content/plugins/toolstruthsocial/settings/options/plugin_options_tabbed.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% 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
5 plugin tags: toolstruthsocial, twitter feeds, truth social media, truth social, feeds

toolstruthsocial/truthsocial.php 92% from 13 tests

The principal PHP file in "WordPress Tools and feeds for Truth Social (TruthSocial) media and Twitter Plugin" v. 1.4 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("toolstruthsocial.php" instead of "truthsocial.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
Everything looks great! No dangerous files found in this plugin4,429 lines of code in 54 files:
LanguageFilesBlank linesComment linesLines of code
PHP407171,1743,869
JavaScript49217241
CSS11296118
JSON20092
Markdown434069
XML22123
YAML10017

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity8.97
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.46
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes39
▷ Abstract classes25.13%
▷ Concrete classes3794.87%
▷ Final classes00.00%
Methods219
▷ Static methods115.02%
▷ Public methods19589.04%
▷ Protected methods52.28%
▷ Private methods198.68%
Functions12
▷ Named functions1083.33%
▷ Anonymous functions216.67%
Constants17
▷ Global constants1482.35%
▷ Class constants317.65%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
settings/images/handle.png0.21KB0.20KB▼ 5.66%
images/logo.png4.83KB3.07KB▼ 36.33%
includes/checkup/bell.png1.07KB0.27KB▼ 74.45%