78% api-fetch-twitter

Code Review | API Fetch Twitter

WordPress plugin API Fetch Twitter scored78%from 54 tests.

About plugin

  • Plugin page: api-fetch-twitter
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.0.2
  • WordPress version: 6.3.1
  • First release: Mar 16, 2022
  • Latest release: Oct 2, 2022
  • Number of updates: 16
  • Update frequency: every 12.5 days
  • Top authors: teatreeman (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /682 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.21MB] [CPU: ▲3.17ms] Passed 4 tests

This is a short check of server-side resources used by API Fetch Twitter
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1939.05 ▲2.59
Dashboard /wp-admin3.56 ▲0.2552.90 ▲6.21
Posts /wp-admin/edit.php3.61 ▲0.2551.56 ▲5.30
Add New Post /wp-admin/post-new.php6.09 ▲0.21100.12 ▲1.80
Media Library /wp-admin/upload.php3.42 ▲0.1937.82 ▲2.98

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 72 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
api_fetch_twitter_options
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by API Fetch Twitter
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,931 ▲19613.64 ▼0.725.40 ▲3.6636.67 ▲0.41
Dashboard /wp-admin2,222 ▲335.86 ▲0.97107.97 ▼9.9340.80 ▼0.96
Posts /wp-admin/edit.php2,105 ▲162.01 ▼0.0241.12 ▲6.7134.55 ▲2.15
Add New Post /wp-admin/post-new.php1,528 ▼517.49 ▼5.59609.77 ▼74.4249.95 ▼4.92
Media Library /wp-admin/upload.php1,404 ▲134.16 ▼0.1193.91 ▼7.2041.92 ▼4.54

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
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • api_fetch_twitter_options
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/api-fetch-twitter/public/partials/api-fetch-twitter-public-display.php
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Abraham\\TwitterOAuth\\Config' not found in wp-content/plugins/api-fetch-twitter/vendor/abraham/twitteroauth/src/TwitterOAuth.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Abraham\\TwitterOAuth\\SignatureMethod' not found in wp-content/plugins/api-fetch-twitter/vendor/abraham/twitteroauth/src/HmacSha1.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/api-fetch-twitter/admin/partials/api-fetch-twitter-admin-display.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 97% 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 ( === api-fetch-twitter === )
You can take inspiration from this readme.txt

api-fetch-twitter/api-fetch-twitter.php Passed 13 tests

The main PHP script in "API Fetch Twitter" version 1.0.0 is automatically included on every request by WordPress
37 characters long description:
Fetch and Display Tweets and Retweets

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
Good job! No executable or dangerous file extensions detected2,949 lines of code in 49 files:
LanguageFilesBlank linesComment linesLines of code
PHP367531,6132,181
JSON400263
JavaScript22954122
Sass1360108
CSS225102
Markdown229078
PO File1182056
XML10039

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity11.50
▷ Minimum class complexity1.00
▷ Maximum class complexity59.00
Average method complexity2.31
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes24
▷ Abstract classes14.17%
▷ Concrete classes2395.83%
▷ Final classes00.00%
Methods180
▷ Static methods4726.11%
▷ Public methods14982.78%
▷ Protected methods10.56%
▷ Private methods3016.67%
Functions8
▷ Named functions450.00%
▷ Anonymous functions450.00%
Constants4
▷ Global constants125.00%
▷ Class constants375.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
9 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/favorite.png1.30KB0.29KB▼ 77.65%
public/images/retweet_hover.png1.07KB0.14KB▼ 87.10%
public/images/reply_hover.png1.13KB0.18KB▼ 83.65%
public/images/favorite_hover.png1.28KB0.27KB▼ 78.50%
public/images/favorite_on.png1.31KB0.33KB▼ 74.57%