10% tweets-widget

Code Review | Tweets Widget

WordPress plugin Tweets Widget scored10%from 54 tests.

About plugin

  • Plugin page: tweets-widget
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-4.5.3
  • WordPress version: 6.3.1
  • First release: Aug 27, 2016
  • Latest release: Aug 29, 2016
  • Number of updates: 12
  • Update frequency: every 0.3 days
  • Top authors: fossasia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,307 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/tweets-widget/api/wp-twitter-api/lib/twitter-api-core.php+80
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▼1.72MB] [CPU: ▼54.60ms] Passed 4 tests

Server-side resources used by Tweets Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.28 ▼1.1810.00 ▼35.71
Dashboard /wp-admin2.30 ▼1.0510.20 ▼54.67
Posts /wp-admin/edit.php2.30 ▼1.0611.00 ▼41.41
Add New Post /wp-admin/post-new.php2.30 ▼3.599.72 ▼86.60
Media Library /wp-admin/upload.php2.30 ▼0.939.18 ▼26.93
Tweets Widget /wp-admin/options-general.php?page=tweets-widget-settings2.3010.76

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 169 new files
Database: no new tables, 9 new options
New WordPress options
can_compress_scripts
widget_recent-posts
loklak_init
loklak-settings[loklak_api]
widget_recent-comments
widget_tweets_widget
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Tweets Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲5914.23 ▼0.122.38 ▲0.1343.58 ▲5.66
Dashboard /wp-admin2,201 ▲345.61 ▼0.1089.73 ▼20.2741.89 ▲1.12
Posts /wp-admin/edit.php2,106 ▲62.02 ▲0.0739.02 ▼1.5337.68 ▲0.72
Add New Post /wp-admin/post-new.php1,533 ▲523.06 ▼0.02660.16 ▼27.2054.84 ▼5.14
Media Library /wp-admin/upload.php1,409 ▲64.23 ▼0.0199.27 ▼4.3546.52 ▼0.50
Tweets Widget /wp-admin/options-general.php?page=tweets-widget-settings8972.1322.9531.80

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/class-requests.php+24
    The PSR-0 `Requests_...` class names in the Requests library are deprecated. Switch to the PSR-4 `WpOrg\Requests\...` class names at your earliest convenience.
  • This plugin does not fully uninstall, leaving 9 options in the database
    • widget_recent-posts
    • db_upgraded
    • loklak_init
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_tweets_widget
    • loklak-settings[loklak_api]
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=tweets-widget-settings
    • > User deprecated in wp-includes/class-requests.php+24
    The PSR-0 `Requests_...` class names in the Requests library are deprecated. Switch to the PSR-4 `WpOrg\Requests\...` class names at your earliest convenience.

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 take a closer look at the following
  • 8× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/tweets-widget/loklak_php_api/Requests/examples/session.php
    • > /wp-content/plugins/tweets-widget/loklak_php_api/Requests/examples/cookie_jar.php
    • > /wp-content/plugins/tweets-widget/loklak_php_api/Requests/examples/get.php
    • > /wp-content/plugins/tweets-widget/loklak_php_api/Requests/examples/basic-auth.php
    • > /wp-content/plugins/tweets-widget/loklak_php_api/Requests/examples/multiple.php
    • > /wp-content/plugins/tweets-widget/loklak_php_api/Requests/bin/create_pear_package.php
    • > /wp-content/plugins/tweets-widget/loklak_php_api/Requests/examples/cookie.php
    • > /wp-content/plugins/tweets-widget/loklak_php_api/Requests/examples/post.php
  • 107× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      include(): Failed opening 'loklak.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/tweets-widget/loklak_php_api/Examples/map.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/tweets-widget/loklak_php_api/Requests/library/Requests/Exception/HTTP/414.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Loklak' not found in wp-content/plugins/tweets-widget/loklak_php_api/Examples/status.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/tweets-widget/loklak_php_api/Requests/library/Requests/Exception/HTTP/306.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Loklak' not found in wp-content/plugins/tweets-widget/loklak_php_api/Examples/search.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/tweets-widget/loklak_php_api/Requests/library/Requests/Exception/HTTP/305.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/tweets-widget/loklak_php_api/Requests/tests/Transport/Base.php:3
    • > PHP Warning
      include(loklak.php): failed to open stream: No such file or directory in wp-content/plugins/tweets-widget/loklak_php_api/Examples/aggregations.php on line 2
    • > PHP Warning
      include(): Failed opening 'loklak.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/tweets-widget/loklak_php_api/Examples/search.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/tweets-widget/loklak_php_api/Requests/library/Requests/Exception/HTTP/500.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === tweets-widget === )
Please take inspiration from this readme.txt

tweets-widget/tweets.php 85% from 13 tests

The principal PHP file in "Tweets Widget" v. 1.0 is loaded by WordPress automatically on each request
The following require your attention:
  • Domain Path: The domain path points to an invalid folder, "/api/lang/" does not exist
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("tweets-widget.php" instead of "tweets.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
Success! There were no dangerous files found in this plugin10,179 lines of code in 150 files:
LanguageFilesBlank linesComment linesLines of code
PHP1111,5833,9688,058
PO File104654751,159
Markdown153020734
JSON30062
YAML39556
XML24053
Bourne Shell415647
CSS1006
Python1104

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity9.88
▷ Minimum class complexity1.00
▷ Maximum class complexity196.00
Average method complexity2.74
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces0
Interfaces4
Traits0
Classes82
▷ Abstract classes11.22%
▷ Concrete classes8198.78%
▷ Final classes00.00%
Methods447
▷ Static methods7617.00%
▷ Public methods39788.81%
▷ Protected methods449.84%
▷ Private methods61.34%
Functions58
▷ Named functions58100.00%
▷ Anonymous functions00.00%
Constants32
▷ Global constants825.00%
▷ Class constants2475.00%
▷ Public constants24100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin