10% export-plugins-and-templates

Code Review | Export Plugins and Templates

WordPress plugin Export Plugins and Templates scored10%from 54 tests.

About plugin

  • Plugin page: export-plugins-an...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Aug 4, 2015
  • Latest release: Sep 11, 2016
  • Number of updates: 11
  • Update frequency: every 36.7 days
  • Top authors: okfie (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

1,000+ active /27,977 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/export-plugins-and-templates/export-plugins-templates.php+11
    define(): Declaration of case-insensitive constants is deprecated

Server metrics [RAM: ▼1.91MB] [CPU: ▼52.92ms] Passed 4 tests

Server-side resources used by Export Plugins and Templates
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.384.88 ▼31.80
Dashboard /wp-admin2.11 ▼1.246.42 ▼52.80
Posts /wp-admin/edit.php2.11 ▼1.256.30 ▼38.41
Add New Post /wp-admin/post-new.php2.11 ▼3.786.44 ▼88.65
Media Library /wp-admin/upload.php2.11 ▼1.125.90 ▼31.29
Export Plugins /wp-admin/plugins.php?page=export_plugins2.215.66
Export Templates /wp-admin/themes.php?page=export_templates2.266.24

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Export Plugins and Templates
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲5114.35 ▼0.221.92 ▲0.0244.16 ▲3.68
Dashboard /wp-admin2,203 ▲285.56 ▼0.2685.66 ▼13.5739.09 ▼2.09
Posts /wp-admin/edit.php2,108 ▲111.98 ▲0.0233.56 ▼3.3135.77 ▼2.29
Add New Post /wp-admin/post-new.php1,536 ▲822.74 ▼0.18660.52 ▼9.1959.92 ▲9.07
Media Library /wp-admin/upload.php1,408 ▲84.17 ▲0.0797.69 ▼3.3344.08 ▼2.62
Export Plugins /wp-admin/plugins.php?page=export_plugins8472.0024.2852.49
Export Templates /wp-admin/themes.php?page=export_templates8571.9925.4227.80

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/export-plugins-and-templates/export-plugins-templates.php+11
    define(): Declaration of case-insensitive constants is deprecated
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/themes.php?page=export_templates
    • > Deprecated in wp-content/plugins/export-plugins-and-templates/export-plugins-templates.php+11
    define(): Declaration of case-insensitive constants is deprecated

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/export-plugins-and-templates/includes/export-plugin-page.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/export-plugins-and-templates/export-plugins-templates.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/export-plugins-and-templates/includes/export-template-page.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Requires at least: The plugin version is formatted incorrectly
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Option of "Export plugins" in the "Plugins" menu.), #2 (Export plugins page.), #3 (Option of "Export Templates" in the "Appearence" menu.), #4 (Export Templates page.)
The official readme.txt might help

export-plugins-and-templates/export-plugins-templates.php 92% from 13 tests

The principal PHP file in "Export Plugins and Templates" v. 1.1 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("export-plugins-and-templates.php" instead of "export-plugins-templates.php")

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
There were no executable files found in this plugin3,230 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP49411,8343,171
PO File1192959

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity553.00
▷ Minimum class complexity553.00
▷ Maximum class complexity553.00
Average method complexity12.04
▷ Minimum method complexity1.00
▷ Maximum method complexity63.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods50
▷ Static methods00.00%
▷ Public methods50100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions21
▷ Named functions21100.00%
▷ Anonymous functions00.00%
Constants63
▷ Global constants63100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png6.22KB3.32KB▼ 46.59%
screenshot-2.png13.92KB7.00KB▼ 49.71%
screenshot-1.png3.91KB2.32KB▼ 40.80%
screenshot-4.png13.34KB6.89KB▼ 48.35%