89% import-tweets-as-posts

Code Review | Import Tweets as Posts

WordPress plugin Import Tweets as Posts scored 89% from 54 tests.

About plugin

  • Plugin page: import-tweets-as-...
  • Plugin version: 3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8.6-4.3
  • WordPress version: 5.8.1
  • First release: Feb 27, 2014
  • Latest release: Nov 25, 2015
  • Number of updates: 51
  • Update frequency: every 12.5 days
  • Top authors: chandanonline4u (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

400+ active / 10,536 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.23MB] [CPU: ▼145.11ms] Passed 4 tests

An overview of server-side resources used by Import Tweets as Posts
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.03 ▲0.1940.29 ▲2.67
Dashboard /wp-admin3.35 ▲0.3048.80 ▼0.59
Posts /wp-admin/edit.php3.40 ▲0.2950.47 ▲0.35
Add New Post /wp-admin/post-new.php5.65 ▲0.2193.92 ▼582.87
Media Library /wp-admin/upload.php3.23 ▲0.2338.34 ▲5.34
Import Tweets as Posts /wp-admin/options-general.php?page=import_tweets_as_posts3.1831.15

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 9 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Import Tweets as Posts
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,712 ▲14015.91 ▲0.369.10 ▼2.2043.01 ▼1.69
Dashboard /wp-admin2,979 ▲456.06 ▼0.08144.88 ▼13.87111.72 ▼1.34
Posts /wp-admin/edit.php2,748 ▲92.73 ▲0.0067.35 ▲0.0799.00 ▲5.04
Add New Post /wp-admin/post-new.php1,511 ▼10418.54 ▼2.74374.76 ▲48.54111.14 ▲9.41
Media Library /wp-admin/upload.php1,757 ▼505.04 ▼0.00161.73 ▼0.32117.48 ▲7.29
Import Tweets as Posts /wp-admin/options-general.php?page=import_tweets_as_posts8881.8733.4951.55

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=import_tweets_as_posts
    • > Error in wp-admin/includes/template.php+1720
    Uncaught ArgumentCountError: Too few arguments to function do_settings_fields(), 1 passed in wp-content/plugins/import-tweets-as-posts/itap-settings.php on line 191 and exactly 2 expected in wp-admin/includes/template.php:1720
    Stack trace:
    #0 wp-content/plugins/import-tweets-as-posts/itap-settings.php(191): do_settings_fields()
    #1 wp-includes/class-wp-hook.php(303): ImportTweetsAsPosts_Settings->itap_plugin_settings_page()
    #2 wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(470): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #6 {main}
    thrown

SRP 50% 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 trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/import-tweets-as-posts/import-tweets-as-posts.php:28

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
7 plugin tags: import tweets as posts, posts, tweets to posts, twitter feeds, import tweets by search query...

import-tweets-as-posts/import-tweets-as-posts.php Passed 13 tests

The main PHP file in "Import Tweets as Posts" ver. 3.0 adds more information about the plugin and also serves as the entry point for this plugin
100 characters long description:
Import tweets from user's timeline or search query as post or custom post type "tweet" in WordPress.

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
Good job! No executable or dangerous file extensions detected1,100 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP42453321,054
JavaScript16634
CSS10012

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity10.77
▷ Minimum class complexity1.00
▷ Maximum class complexity45.00
Average method complexity2.63
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes215.38%
▷ Concrete classes1184.62%
▷ Final classes00.00%
Methods82
▷ Static methods1012.20%
▷ Public methods7186.59%
▷ Protected methods22.44%
▷ Private methods910.98%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/paypal.png5.39KB1.65KB▼ 69.31%