78% weeblramp

Code Review | AMP on WordPress - weeblrAMP CE

WordPress plugin AMP on WordPress - weeblrAMP CE scored78%from 54 tests.

About plugin

  • Plugin page: weeblramp
  • Plugin version: 1.12.5.783
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.4
  • WordPress version: 6.3.1
  • First release: Jul 23, 2017
  • Latest release: May 19, 2020
  • Number of updates: 37
  • Update frequency: every 28.0 days
  • Top authors: weeblrpress (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

200+ active /15,547 total downloads

Benchmarks

Plugin footprint 82% from 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: ▲2.44MB] [CPU: ▲17.38ms] Passed 4 tests

A check of server-side resources used by AMP on WordPress - weeblrAMP CE
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.49 ▲2.0267.07 ▲25.29
Dashboard /wp-admin5.92 ▲2.6271.41 ▲15.04
Posts /wp-admin/edit.php6.00 ▲2.6474.08 ▲19.45
Add New Post /wp-admin/post-new.php8.45 ▲2.56118.65 ▲11.65
Media Library /wp-admin/upload.php5.79 ▲2.5665.28 ▲23.37
Settings /wp-admin/admin.php?page=weeblramp-settings6.55102.43
Customize /wp-admin/admin.php?page=weeblramp-customize6.4793.13

Server storage [IO: ▲2.46MB] [DB: ▲0.00MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Please try to fix the following items
  • Illegal file modification detected: 1 file (11.77KB) outside of "wp-content/plugins/weeblramp/" and "wp-content/uploads/"
    • (new file) wp-content/mu-plugins/weeblramp_plugins_handler.php
Filesystem: 537 new files
Database: 1 new table, 14 new options
New tables
wp_wblib_keystore
New WordPress options
wblib_last_installed_version_weeblramp/weeblramp.php
weeblramp_last_amp_suffix
theysaidso_admin_options
weeblramp_current_stylesheet
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
db_upgraded
weeblramp_last_op_mode
weeblramp_last_post_types_hash
...

Browser metrics Passed 4 tests

An overview of browser requirements for AMP on WordPress - weeblrAMP CE
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲6913.25 ▼1.161.90 ▲0.0940.48 ▼4.38
Dashboard /wp-admin2,246 ▲584.89 ▲0.01111.51 ▼5.5842.71 ▼1.37
Posts /wp-admin/edit.php2,129 ▲402.03 ▼0.0035.89 ▼2.9038.30 ▲1.90
Add New Post /wp-admin/post-new.php6,263 ▲4,74419.17 ▼3.91888.88 ▲209.1253.69 ▼7.55
Media Library /wp-admin/upload.php1,428 ▲404.27 ▲0.1395.71 ▼28.9442.74 ▼5.74
Settings /wp-admin/admin.php?page=weeblramp-settings3,9993.9694.6638.34
Customize /wp-admin/admin.php?page=weeblramp-customize7,55710.10308.2370.83

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 10 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • wblib_last_installed_version_weeblramp/weeblramp.php
    • widget_recent-posts
    • db_upgraded
    • weeblramp_current_template
    • weeblramp_activation_plugin_manager_errors
    • weeblramp_current_stylesheet
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 0% 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
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/weeblramp/vendor/weeblr/wblib/wblib.php
  • 73× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'WEEBLRAMP_AMP__DIR__includes/embeds/class-amp-base-embed-handler.php' (include_path='.:/usr/share/php') in wp-content/plugins/weeblramp/vendor/wp/includes/embeds/class-amp-tumblr-embed-handler.php on line 10
    • > PHP Fatal error
      Uncaught Error: Class 'Joomla\\Registry\\AbstractRegistryFormat' not found in wp-content/plugins/weeblramp/vendor/weeblr/wblib/vendor/joomla/registry/src/Format/Ini.php:20
    • > PHP Warning
      Use of undefined constant WEEBLRAMP_AMP__DIR__ - assumed 'WEEBLRAMP_AMP__DIR__' (this will throw an Error in a future version of PHP) in wp-content/plugins/weeblramp/vendor/wp/includes/embeds/class-amp-dailymotion-embed.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'Weeblr\\Wblib\\Joomla\\Uri\\AbstractUri' not found in wp-content/plugins/weeblramp/vendor/weeblr/wblib/vendor/joomla/uri/src/Uri.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Weeblr\\Wblib\\Joomla\\Uri\\AbstractUri' not found in wp-content/plugins/weeblramp/vendor/weeblr/wblib/vendor/joomla/uri/src/UriImmutable.php:19
    • > PHP Warning
      require_once(WEEBLRAMP_AMP__DIR__includes/embeds/class-amp-base-embed-handler.php): failed to open stream: No such file or directory in wp-content/plugins/weeblramp/vendor/wp/includes/embeds/class-amp-vine-embed.php on line 9
    • > PHP Warning
      require_once(WEEBLRAMP_AMP__DIR__includes/sanitizers/class-amp-base-sanitizer.php): failed to open stream: No such file or directory in wp-content/plugins/weeblramp/vendor/wp/includes/sanitizers/class-amp-iframe-sanitizer.php on line 4
    • > PHP Fatal error
      Uncaught Exception: weeblrAMP: unsupported feature in wp-content/plugins/weeblramp/public/amp-comments-post.php:26
    • > PHP Warning
      require_once(WEEBLRAMP_AMP__DIR__includes/sanitizers/class-amp-base-sanitizer.php): failed to open stream: No such file or directory in wp-content/plugins/weeblramp/vendor/wp/includes/sanitizers/class-amp-img-sanitizer.php on line 5
    • > PHP Warning
      Use of undefined constant WEEBLRAMP_AMP__DIR__ - assumed 'WEEBLRAMP_AMP__DIR__' (this will throw an Error in a future version of PHP) in wp-content/plugins/weeblramp/vendor/wp/includes/embeds/class-amp-soundcloud-embed.php on line 9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
4 plugin tags: mobile optimization, amp, accelerated mobile pages, seo

weeblramp/weeblramp.php Passed 13 tests

The primary PHP file in "AMP on WordPress - weeblrAMP CE" version 1.12.5.783 is used by WordPress to initiate all plugin functionality
55 characters long description:
Provides Accelerated Mobile Pages support for Wordpress

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
There were no executable files found in this plugin33,527 lines of code in 395 files:
LanguageFilesBlank linesComment linesLines of code
PHP3147,06616,75529,033
LESS244315662,237
JavaScript133106691,763
Pascal172163193
CSS3405135
Markdown119086
PO File2111256
JSON30021
SVG2002
HTML1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity18.57
▷ Minimum class complexity1.00
▷ Maximum class complexity207.00
Average method complexity3.44
▷ Minimum method complexity1.00
▷ Maximum method complexity52.00
Code structure
Namespaces4
Interfaces2
Traits0
Classes162
▷ Abstract classes63.70%
▷ Concrete classes15696.30%
▷ Final classes10.64%
Methods1,203
▷ Static methods31726.35%
▷ Public methods82168.25%
▷ Protected methods21417.79%
▷ Private methods16813.97%
Functions82
▷ Named functions7692.68%
▷ Anonymous functions67.32%
Constants258
▷ Global constants3513.57%
▷ Class constants22386.43%
▷ Public constants223100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
33 compressed PNG files occupy 0.23MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/admin/dist/img/2016-08-21-weeblramp-logo-h60px-margin.png1.31KB1.31KB0.00%
assets/admin/dist/img/2016-08-21-weeblramp-logo-h100px-margin.png2.06KB2.07KB0.00%
assets/admin/dist/img/2016-08-21-weeblramp-logo-background-h200px-margin.png4.45KB4.48KB0.00%
assets/default/src/img/2016-08-21-weeblramp-update-banner-small.png13.32KB6.17KB▼ 53.68%
assets/admin/dist/img/2016-08-21-weeblramp-update-banner-small.png3.44KB3.44KB0.00%