84% github-embed

Code Review | Github Embed

WordPress plugin Github Embed scored 84% from 54 tests.

About plugin

  • Plugin page: github-embed
  • Plugin version: 2.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.2
  • WordPress version: 6.3.1
  • First release: Feb 4, 2013
  • Latest release: Mar 21, 2023
  • Number of updates: 50
  • Update frequency: every 73.9 days
  • Top authors: leewillis77 (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

1,000+ active / 21,327 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

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

Server-side resources used by Github Embed
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0336.68 ▲0.72
Dashboard /wp-admin3.32 ▲0.0249.94 ▲5.25
Posts /wp-admin/edit.php3.37 ▲0.0143.01 ▲1.89
Add New Post /wp-admin/post-new.php5.90 ▲0.0195.68 ▲7.67
Media Library /wp-admin/upload.php3.24 ▲0.0133.47 ▲3.54

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 17 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded
github_oembed_key
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Github Embed
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲5614.42 ▲0.041.82 ▲0.3244.81 ▲4.94
Dashboard /wp-admin2,200 ▲94.88 ▼1.06125.62 ▲10.8550.73 ▼0.80
Posts /wp-admin/edit.php2,092 ▲32.05 ▲0.0242.89 ▲5.8432.89 ▼2.30
Add New Post /wp-admin/post-new.php1,533 ▲1423.33 ▲0.05673.45 ▲71.1855.48 ▲5.96
Media Library /wp-admin/upload.php1,391 ▲64.26 ▲0.06110.38 ▲6.0946.39 ▲0.88

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • github_oembed_key
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% 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
Please fix the following
  • 13× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/github-embed/templates/repository_milestone_summary.php on line 1
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/github-embed/templates/repository_milestone_summary.php on line 1
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/github-embed/templates/repository.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/github-embed/templates/repository.php:3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/github-embed/templates/repository.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/github-embed/templates/author.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/github-embed/templates/repository_milestone_summary.php:3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/github-embed/templates/repository_contributors.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/github-embed/templates/repository_contributors.php:3
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/github-embed/templates/author.php on line 1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: oembed, embed, github

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

The entry point to "Github Embed" version 2.1.0 is a PHP file that has certain tags in its header comment area
130 characters long description:
Paste the URL to a Github project into your posts or pages, and have the project information pulled in and displayed automatically

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected377 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP661163347
CSS14030

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity15.50
▷ Minimum class complexity10.00
▷ Maximum class complexity21.00
Average method complexity2.26
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods23
▷ Static methods00.00%
▷ Public methods1565.22%
▷ Protected methods00.00%
▷ Private methods834.78%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
8 PNG files occupy 1.27MB with 0.72MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png17.85KB7.22KB▼ 59.56%
img/github-logos/octocat.png4.52KB1.63KB▼ 63.88%
img/github-logos/mark.png2.70KB1.12KB▼ 58.42%
screenshot-2.png4.90KB2.77KB▼ 43.48%
banner-772x250.png118.46KB47.34KB▼ 60.04%