Plugin Directory

Changeset 3250619


Ignore:
Timestamp:
03/04/2025 06:17:04 PM (13 months ago)
Author:
topirank
Message:

Init version 1.1.1

Location:
topirank-integration
Files:
32 added
4 edited

Legend:

Unmodified
Added
Removed
  • topirank-integration/trunk/includes/extract-and-create.php

    r3249873 r3250619  
    105105
    106106    while ($wp_filesystem->is_dir($path)) {
    107         $archive_name = $original_name . '(' . $counter . ')';
     107        $archive_name = $original_name . '--(' . $counter . ')';
    108108        $path = dirname($original_path) . '/' . $archive_name;
    109109        $counter++;
  • topirank-integration/trunk/includes/register-files.php

    r3249873 r3250619  
    117117    if (is_dir($js_path)) {
    118118        $js_files = glob($js_path . '/*.js');
    119 
    120119        $current_slug = sanitize_title($post->post_name);
     120        $clean_archive_name = preg_replace('/--\d+$/', '', $archive_name);
    121121
    122122        foreach ($js_files as $js_file) {
     123
    123124            $file_name = basename($js_file, '.js');
    124             $file_name = str_replace('-script', '', $file_name);
    125 
    126             $slug_pos = strpos($file_name, $current_slug);
    127 
    128             if ($slug_pos === 0) {
    129                 $file_name = substr_replace($file_name, '', $slug_pos, strlen($current_slug));
    130                 $page_pos = strpos($file_name, '-page-');
    131                 if ($page_pos !== false) {
    132                     $file_name = substr_replace($file_name, '', $page_pos, 6);
    133                 }
    134 
    135                 if (strpos($file_name, $current_slug) === false) {
    136                     continue;
    137                 }
     125            $file_name = preg_replace('/-script$/', '', $file_name);
     126
     127            if (strpos($file_name, '-page-') === false) {
     128                wp_enqueue_script(
     129                    'topirank-archive-js-' . sanitize_title($file_name),
     130                    $js_url . '/' . basename($js_file),
     131                    [],
     132                    time(),
     133                    true
     134                );
     135                continue;
     136            }
     137
     138            $file_name = str_replace($clean_archive_name, '', $file_name);
     139            $file_name = preg_replace('/-page-/', '', $file_name, 1);
     140
     141            if (strpos($file_name, $current_slug) === false) {
     142                continue;
    138143            }
    139144
  • topirank-integration/trunk/readme.txt

    r3249873 r3250619  
    44Requires at least: 6.0
    55Tested up to: 6.7.1
    6 Stable tag: 1.1
     6Stable tag: 1.1.1
    77Requires PHP: 7.3
    88License: GPLv2 or later
     
    5858== Changelog ==
    5959
     60= 1.1.1 =
     61* Optimize JS file inclusion.
     62
    6063= 1.1 =
    6164* Optimized parsing.
  • topirank-integration/trunk/topirank-integration.php

    r3249873 r3250619  
    33Plugin Name: Topirank Integration
    44Description: Plugin for parsing pages
    5 Version: 1.1
     5Version: 1.1.1
    66Author: Topirank
    77License: GPLv2 or later
Note: See TracChangeset for help on using the changeset viewer.