94% twitter-embed

Code Review | Twitter Embed

WordPress plugin Twitter Embed scored 94% from 54 tests.

About plugin

  • Plugin page: twitter-embed
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.5
  • WordPress version: 5.9.2
  • First release: Jan 1, 2012
  • Latest release: Dec 30, 2012
  • Number of updates: 8
  • Update frequency: every 45.5 days
  • Top authors: kovshenin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

600+ active / 19,607 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

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

Server-side resources used by Twitter Embed
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.0556.10 ▲8.44
Dashboard /wp-admin3.43 ▲0.0133.30 ▼1.24
Posts /wp-admin/edit.php3.66 ▲0.0137.57 ▲1.81
Add New Post /wp-admin/post-new.php6.90 ▼0.0799.94 ▼1,131.79
Media Library /wp-admin/upload.php3.31 ▲0.0125.70 ▼1.30

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Twitter Embed
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,795 ▲5316.22 ▲0.576.69 ▲0.033.51 ▲1.43
Dashboard /wp-admin2,892 ▲386.21 ▼0.06120.43 ▼16.36155.19 ▼6.70
Posts /wp-admin/edit.php2,685 ▼03.07 ▼0.1762.73 ▼1.45138.08 ▼3.34
Add New Post /wp-admin/post-new.php1,711 ▲5020.61 ▲4.75446.61 ▲46.12156.59 ▲2.52
Media Library /wp-admin/upload.php1,695 ▼65.48 ▼0.06138.07 ▼0.53189.52 ▼1.25

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Uninstall script ran successfully

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
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 add_action() in wp-content/plugins/twitter-embed/twitter-embed.php:21

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)
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: Add images for these screenshots: #1 (This is how your embedded tweets will appear on your blog or site.), #2 (This is how you embed your tweets in the editor -- just a link on it's own line or a shortcode.)
Please take inspiration from this readme.txt

twitter-embed/twitter-embed.php Passed 13 tests

The principal PHP file in "Twitter Embed" v. 1.1.1 is loaded by WordPress automatically on each request
107 characters long description:
Easily embed tweets in your WordPress posts and pages via shortcode, embed HTML or URL on a line by itself.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected40 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1113340

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.07MB with 0.05MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png29.36KB9.13KB▼ 68.89%
screenshot-2.png38.50KB11.88KB▼ 69.14%