Karina Klinkevičiūtė
Karina Klinkevičiūtė

Reputation: 1538

My wordpress plugin isn't installing from a zip file

I created a WP plugin, with minimal PHP code - it's almost JS. When I upload files manually to the WP plugins directory, it works.

But when I'm trying to zip the plugin and install it from a zip file, it doesn't work.

The PHP code itself is minimal.

I created a header with minimal requirements and some code to return html and to registre JS and CSS files.

There are other files too: image files, JS files (2 of them)

When I'm trying to install them, I get a message: The link you followed has expired.

Please try again.

I did everything according to tutorials, checked with several of them, and I have no Idea what I'm doing wrong.

Here's my code:

<?php
/**
 * Plugin Name: Plugin name
 * Description: Plugin description
 * Version: 1.0.1
 * Author: Author
 */



function dare2care( $atts, $content, $tag ){

    wp_register_style( 'dare2care', 'https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css' );

    wp_enqueue_style('dare2care');

    wp_enqueue_script('dare2care-quiz', plugins_url( 'dare2care-quiz.js', __FILE__ ), in_footer:true);

    $image_base_url = plugins_url( 'images/', __FILE__ );

 $content = '


    <div id="quiz" class="container">
        ... truncated...
    </div>

';

return $content;

};

add_shortcode('d2c', 'dare2care');

function register_shortcodes(){
    add_shortcode('d2c', 'dare2care');
};

add_action( 'init', 'register_shortcodes');

?>

Upvotes: 0

Views: 545

Answers (1)

George Vasiliades
George Vasiliades

Reputation: 81

You have to add this to your theme functions.php

@ini_set( 'upload_max_size' , '120M' );
@ini_set( 'post_max_size', '120M');
@ini_set( 'max_execution_time', '300' );

It's a known issue that needs a deeper approach to avoid. I don't know if I can analyze the whole situation assuming to stackoverflow rules.

Upvotes: 1

Related Questions