78% recent-tweet

Code Review | Recent Tweet

WordPress plugin Recent Tweet scored78%from 54 tests.

About plugin

  • Plugin page: recent-tweet
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.1-4.5.3
  • WordPress version: 6.3.1
  • First release: Aug 25, 2016
  • Latest release: Aug 26, 2016
  • Number of updates: 2
  • Update frequency: every 10.5 days
  • Top authors: fossasia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /827 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼7.85ms] Passed 4 tests

A check of server-side resources used by Recent Tweet
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.48 ▼1.87
Dashboard /wp-admin3.32 ▲0.0142.38 ▼5.98
Posts /wp-admin/edit.php3.37 ▲0.0140.71 ▼7.50
Add New Post /wp-admin/post-new.php5.92 ▲0.0378.82 ▼16.05
Media Library /wp-admin/upload.php3.24 ▲0.0132.24 ▼1.57

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 141 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_fa_widget_recent_tweet
widget_theysaidso_widget

Browser metrics Passed 4 tests

Recent Tweet: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.69 ▼0.891.61 ▲0.0338.28 ▼4.84
Dashboard /wp-admin2,208 ▲175.89 ▲1.03103.54 ▼2.8938.87 ▼7.27
Posts /wp-admin/edit.php2,091 ▲22.04 ▲0.0336.72 ▼3.4632.29 ▼6.18
Add New Post /wp-admin/post-new.php1,530 ▼023.10 ▲4.79634.26 ▲36.3251.96 ▲1.22
Media Library /wp-admin/upload.php1,384 ▼74.25 ▲0.02101.85 ▲3.8842.94 ▲0.74

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

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 9× PHP files output text when accessed directly:
    • > /wp-content/plugins/recent-tweet/loklak_php_api/Requests/examples/post.php
    • > /wp-content/plugins/recent-tweet/recent-tweet.php
    • > /wp-content/plugins/recent-tweet/loklak_php_api/Requests/examples/basic-auth.php
    • > /wp-content/plugins/recent-tweet/loklak_php_api/Requests/examples/session.php
    • > /wp-content/plugins/recent-tweet/loklak_php_api/Requests/examples/cookie_jar.php
    • > /wp-content/plugins/recent-tweet/loklak_php_api/Requests/examples/cookie.php
    • > /wp-content/plugins/recent-tweet/loklak_php_api/Requests/examples/get.php
    • > /wp-content/plugins/recent-tweet/loklak_php_api/Requests/examples/multiple.php
    • > /wp-content/plugins/recent-tweet/loklak_php_api/Requests/bin/create_pear_package.php
  • 101× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      include(): Failed opening 'loklak.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/recent-tweet/loklak_php_api/Examples/geocode.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/recent-tweet/loklak_php_api/Requests/tests/Response/Headers.php:3
    • > PHP Warning
      include(): Failed opening 'loklak.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/recent-tweet/loklak_php_api/Examples/search.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/recent-tweet/loklak_php_api/Requests/tests/IDNAEncoder.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/recent-tweet/loklak_php_api/Requests/library/Requests/Exception/HTTP/400.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Loklak' not found in wp-content/plugins/recent-tweet/loklak_php_api/Examples/user.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Loklak' not found in wp-content/plugins/recent-tweet/loklak_php_api/Examples/map.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Loklak' not found in wp-content/plugins/recent-tweet/loklak_php_api/Examples/hello.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/recent-tweet/loklak_php_api/Requests/tests/Encoding.php:3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/recent-tweet/loklak_php_api/Requests/bin/create_pear_package.php on line 12

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)
There were no browser issues found

Optimizations

Plugin configuration 93% 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 your attention:
  • Screenshots: Screenshot #1 (The widget) image not found
Please take inspiration from this readme.txt

recent-tweet/recent-tweet.php 92% from 13 tests

The principal PHP file in "Recent Tweet" v. 1.0 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 357 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin7,716 lines of code in 129 files:
LanguageFilesBlank linesComment linesLines of code
PHP1031,4853,8406,800
Markdown132890696
JSON30062
YAML39556
XML12037
CSS24029
JavaScript12020
Bourne Shell24012
Python1104

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity10.15
▷ Minimum class complexity1.00
▷ Maximum class complexity196.00
Average method complexity2.73
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces0
Interfaces4
Traits0
Classes85
▷ Abstract classes33.53%
▷ Concrete classes8296.47%
▷ Final classes00.00%
Methods473
▷ Static methods8016.91%
▷ Public methods41788.16%
▷ Protected methods469.73%
▷ Private methods102.11%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants27
▷ Global constants311.11%
▷ Class constants2488.89%
▷ Public constants24100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 0.23MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-128x128.png12.40KB8.62KB▼ 30.46%
assets/screenshot-2.png91.44KB35.65KB▼ 61.01%
assets/screenshot-1.png31.77KB12.10KB▼ 61.91%
assets/tweet.png1.33KB0.69KB▼ 48.27%
assets/banner-772x250.png63.24KB28.90KB▼ 54.30%