10% ansar-import

Code Review | Ansar Import

WordPress plugin Ansar Import scored10%from 54 tests.

About plugin

  • Plugin page: ansar-import
  • Plugin version: 1.0.15
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3.1
  • WordPress version: 6.3.1
  • First release: Jul 7, 2020
  • Latest release: Sep 18, 2023
  • Number of updates: 15
  • Update frequency: every 77.9 days
  • Top authors: themeansar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20,000+ active /197,804 total downloads


Plugin footprint 58% 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
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > User error in wp-content/plugins/ansar-import/includes/class-ansar-import-activator.php+38
    Ansar Import - This plugin requires Official Theme Ansar Theme to be activated to work.

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.06ms] Passed 4 tests

This is a short check of server-side resources used by Ansar Import
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.51 ▼3.41
Dashboard /wp-admin3.31 ▲0.0049.05 ▼5.62
Posts /wp-admin/edit.php3.36 ▲0.0048.48 ▼1.25
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.18 ▼13.97
Media Library /wp-admin/upload.php3.23 ▲0.0037.36 ▲1.59

Server storage [IO: ▲0.64MB] [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: 32 new files
Database: no new tables, 6 new options
New WordPress options

Browser metrics Passed 4 tests

Checking browser requirements for Ansar Import
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.41 ▲0.151.57 ▼0.2344.58 ▲2.40
Dashboard /wp-admin2,189 ▲125.54 ▼0.1193.75 ▼7.6440.33 ▼6.21
Posts /wp-admin/edit.php2,097 ▼02.02 ▲0.0335.24 ▼4.0532.30 ▼3.58
Add New Post /wp-admin/post-new.php1,526 ▼023.58 ▲0.10692.77 ▲38.3561.70 ▲0.81
Media Library /wp-admin/upload.php1,403 ▲34.22 ▲0.05108.57 ▲0.7249.52 ▲0.48

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

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
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/ansar-import/public/partials/ansar-import-public-display.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Importer' not found in wp-content/plugins/ansar-import/includes/class-wp-import.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_theme() in wp-content/plugins/ansar-import/admin/partials/ansar-import-admin-display.php:15

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)
Everything seems fine, but this is not an exhaustive test


Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Screenshots: These screenshots do not have images: #1 (Theme Demos listing page.), #2 (Install and activate the required plugins.), #3 (Finally, Import the Demo with just one click.)
The official readme.txt might help

ansar-import/ansar-import.php Passed 13 tests

Analyzing the main PHP file in "Ansar Import" version 1.0.15
54 characters long description:
Ansar Import for Importing demo data Themeansar Theme.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin2,426 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity30.83
▷ Minimum class complexity1.00
▷ Maximum class complexity188.00
Average method complexity5.42
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
▷ Static methods44.94%
▷ Public methods7390.12%
▷ Protected methods33.70%
▷ Private methods56.17%
▷ Named functions3100.00%
▷ Anonymous functions00.00%
▷ Global constants1100.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
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/partials/image/logo.png9.88KB3.56KB▼ 63.97%