Giter Club home page Giter Club logo

wp-reactivate's Issues

Heavy prod .js file

My app folder weights 110Kb, however the final shortcode.js file is almost 700Kb.
I have tried source-map-explorer in order to analyze the prod files. But the analysis doesn't give anything. I suspect for the following reason described in the package page:

"For source-map-explorer to be useful, you need to generate a source map which maps positions in your minified file all the way back to the files from which they came.
If you use browserify, you can generate a JavaScript file with an inline source map using the --debug flag:
browserify -r .:foo --debug -o foo.bundle.js
source-map-explorer foo.bundle.js"

How can I lower the weight of my prod .js file?
Or any chance I can eject the config in order to add the --debug flag?

Cannot load css file from an external module.

I am trying to add React Tostify module on a clean install of your plugin as a shortcode and I have problems loading the css file from this module. I am loading the css file in shortcode.jsx via:

import 'react-toastify/dist/ReactToastify.css';

I get the following error:

Uncaught Error: Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type.

.Toastify__toast-container

I've tried putting the css file in the same folder as the shortcode and play around with webpack.config.js but nothing seems to work. Any advice would be appreciated.

Moving Plugin From Admin Settings to its own Admin Menu Item

Hi awesome plugin this has been such a huge help for some projects that I have been working on. The only issue that I am having is when trying to move the plugin out from a sub item under Settings to its own admin menu item. Any ideas on how to go about this? Your help would be greatly appreciated thanks!

Typescript Support

Hello fellow developers!

Is there any Typescript support ? I tried to implement it myself but failed :(

I tried following this: https://webpack.js.org/guides/typescript/ but it didn't work and spew a bunch of errors out.

ERROR in ./app/shortcode.ts 11:75
Module parse failed: Unexpected token (11:75)
File was processed with these loaders:
 * ./node_modules/ts-loader/index.js
You may need an additional loader to handle the result of these loaders.
|     for (var i = 0; i < shortcode_containers.length; ++i) {
|         var objectId = shortcode_containers[i].getAttribute('data-object-id');
>         ReactDOM.render(wpObject, (_a = { window: window }, _a[objectId] = , _a) /  > , shortcode_containers[i]);
|     }
| });

Hope someone can help me :)

Accessing the WP Reactivate settings page throws error

Visiting this directory /wp-admin/options-general.php?page=wp-reactivate on my local Wordpress install throws this error in the console:

Admin.jsx:16 Uncaught TypeError: Cannot read property 'api_url' of undefined at
Admin._this.getSetting (Admin.jsx:16)

The error is referring to this function:

  getSetting = () => {
    fetch(`${this.props.wpObject.api_url}settings`, {
      credentials: 'same-origin',
      method: 'GET',
      headers: {
        'Content-Type': 'application/json',
        'X-WP-Nonce': this.props.wpObject.api_nonce,
      },
    })
    .then(response => response.json())
    .then(
      (json) => this.setState({ settings: json.wpreactivate }),
      (err) => console.log('error', err)
    );
  };

routing

Hi there,

Sorry if I'm asking something obvious. I'm a newbie to working with wordpress.

There is nothing about routing in the documentation or setup. Can you guys elaborate on that a bit?

For example let's say my plugin is loaded at /myplugin (http://my-site-url.com/myplugin) by wordpress. And the sub-routes of /myplugin is handled by react-router e.g. /myplugin/myroute1 (http://site-url.com/myplugin/myroute1) or /myplugin/myroute2 (http://site-url.com/myplugin/myroute2) etc which works fine (for me without an issue using react-router-dom project).

However, wordpress yields "OOPS! THAT PAGE CAN’T BE FOUND." when I try to load the site directly with a subroute in the address bar e.g. http://site-url.com/myplugin/myroute2.

Thanks.

React widget not updating with code changes

#Hi,

When I change the code the for widget, it doesn't update it when I refresh the page. For example when I add a react component to the widget view and refresh the page, there are no changes. Even when I add plan html there are no changes.

I rebuild the project but no luck. Any ideas?

EDIT: -----
It was an issue with another part of my setup

local changes not showing up in the web app

Changes to the admin panel are not showing up under settings. Even after I run the build command.
Expecting the following to show up on the admin panel:
```

WP Reactivate Settings

Demo Setting: ``` but nothing mounts.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.