83% import-tweets-as-wp-posts

Code Review | Import Tweets as WP Posts

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

About plugin

  • Plugin page: import-tweets-as-...
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.8
  • WordPress version: 5.8.1
  • First release: Nov 13, 2015
  • Latest release: Dec 1, 2017
  • Number of updates: 8
  • Update frequency: every 93.9 days
  • Top authors: enguerranws (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

60+ active / 2,880 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼142.28ms] Passed 4 tests

Analyzing server-side resources used by Import Tweets as WP Posts
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.1746.69 ▲24.46
Dashboard /wp-admin3.13 ▲0.0755.21 ▲2.66
Posts /wp-admin/edit.php3.18 ▲0.0753.62 ▲0.17
Add New Post /wp-admin/post-new.php5.48 ▲0.0597.53 ▼568.54
Media Library /wp-admin/upload.php3.07 ▲0.0737.14 ▼3.42
Twitter Importer /wp-admin/options-general.php?page=tweets-to-posts3.0538.13

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 65 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Import Tweets as WP Posts
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,701 ▲12915.99 ▲0.438.42 ▼3.9952.43 ▲0.14
Dashboard /wp-admin2,988 ▲515.89 ▼0.03157.21 ▼5.47118.25 ▼2.76
Posts /wp-admin/edit.php2,746 ▲72.60 ▼0.1275.10 ▼8.7198.77 ▲3.68
Add New Post /wp-admin/post-new.php1,698 ▲8318.74 ▼2.38435.67 ▲129.21117.30 ▲3.06
Media Library /wp-admin/upload.php1,757 ▼505.02 ▼0.04175.69 ▲2.20128.93 ▲4.94
Twitter Importer /wp-admin/options-general.php?page=tweets-to-posts1,2272.0857.2083.84

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstall script ran successfully

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/import-tweets-as-wp-posts/vendor/j7mbo/twitter-api-php/index.php
  • 15× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/import-tweets-as-wp-posts/vendor/abraham/twitteroauth/tests/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/import-tweets-as-wp-posts/vendor/abraham/twitteroauth/tests/bootstrap.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/import-tweets-as-wp-posts/vendor/abraham/twitteroauth/tests/Util/JsonDecoderTest.php:7
    • > PHP Warning
      require(wp-content/plugins/import-tweets-as-wp-posts/vendor/abraham/twitteroauth/tests/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/import-tweets-as-wp-posts/vendor/abraham/twitteroauth/tests/bootstrap.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/import-tweets-as-wp-posts/vendor/abraham/twitteroauth/tests/AbstractSignatureMethodTest.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/import-tweets-as-wp-posts/admin.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/import-tweets-as-wp-posts/vendor/abraham/twitteroauth/tests/TwitterOAuthTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Abraham\\TwitterOAuth\\SignatureMethod' not found in wp-content/plugins/import-tweets-as-wp-posts/vendor/abraham/twitteroauth/src/HmacSha1.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Abraham\\TwitterOAuth\\Tests\\AbstractSignatureMethodTest' not found in wp-content/plugins/import-tweets-as-wp-posts/vendor/abraham/twitteroauth/tests/HmacSha1Test.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Abraham\\TwitterOAuth\\Config' not found in wp-content/plugins/import-tweets-as-wp-posts/vendor/abraham/twitteroauth/src/TwitterOAuth.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/import-tweets-as-wp-posts/options.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=tweets-to-posts
    • > Network (severe)
    wp-content/plugins/import-tweets-as-wp-posts/tweetie.min.js?ver=5.8.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === import-tweets-as-wp-posts === )
You can take inspiration from this readme.txt

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

Analyzing the main PHP file in "Import Tweets as WP Posts" version 1.3
109 characters long description:
Get a tweets list from a request (hashtag, user, free request) and add their content to your own Wordpress :)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin3,085 lines of code in 52 files:
LanguageFilesBlank linesComment linesLines of code
PHP335391,0652,136
PO File295194232
JavaScript1391216
Markdown6810194
JSON400182
CSS16062
XML32141
YAML23022

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity7.59
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity1.95
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes22
▷ Abstract classes29.09%
▷ Concrete classes2090.91%
▷ Final classes00.00%
Methods159
▷ Static methods106.29%
▷ Public methods13987.42%
▷ Protected methods53.14%
▷ Private methods159.43%
Functions18
▷ Named functions1583.33%
▷ Anonymous functions316.67%
Constants19
▷ Global constants1263.16%
▷ Class constants736.84%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/logo-t2p.png3.68KB1.76KB▼ 52.02%
vendor/j7mbo/twitter-api-php/test/img.png18.88KB10.40KB▼ 44.90%