Forum Replies Created

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter tskpbls

    (@tskpbls)

    I’d be glad if someone could try to explain me why, if I add a js file called test under my theme and use :

    function my_custom_js() {
        echo '<script type="text/javascript" src="js/test.js></script>';
    }
    add_action( 'wp_footer', 'my_custom_js' );

    under functions.php

    it does not work, but if I paste directly my test.js code inside wp_footer it’s working correctly. What I am doing wrong?

    • This reply was modified 2 years, 10 months ago by tskpbls.
    Thread Starter tskpbls

    (@tskpbls)

    To make short, here’s my question:

    The code inside movie.php can go inside :
    the functions.php file.

    The movie.php file itself can go :
    under the mu-plugins folder.

    What are the other solutions?

    I think, I was expecting the wpcli command to create the cpt, not just its code.

    Thread Starter tskpbls

    (@tskpbls)

    Hi @jakept , thanks a lot for the very quick response.

    post-types is the folder created under wp-content/themes/twentytwentyone in my case, by the command itself.

    see : https://developer.www.ads-software.com/cli/commands/scaffold/post-type/

    # Generate a 'movie' post type for the 'simple-life' theme
    $ wp scaffold post-type movie --label=Movie --theme=simple-life
    Success: Created '/var/www/example.com/public_html/wp-content/themes/simple-life/post-types/movie.php'.

    So instead of having the code inside the functions.php of a child theme, it creates a specific file for that code, with the path mentioned above.

    Of course, I could create a plugin inside the mu-plugins folder from the movie.php file or copy/paste its code inside functions.php and get rid of it…

    But in that case, what would be the point of having that specific folder created?

    Please consider this as an intermediate (not beginner) question. I know how to use the wpcli/command line, I know about functions.php, child themes and so on… But I would not know what to do now with that movie.php file.

    It’s there for a reason, and I am probably missing something silly to have the CPT shown inside the menu.

    Thanks!

    • This reply was modified 2 years, 11 months ago by tskpbls. Reason: Rephrasing
    Thread Starter tskpbls

    (@tskpbls)

    Hi @eagerbob, @bcworkz

    Thanks a lot for your answers.

    Please consider that I am making my very first steps with git. I do not consider myself as a developer, although I think I have a good knowledge on everything wordpress…

    @bcworkz

    Why would you want to include WP core in your repository?

    Because I have no method nor strategy yet on how to use git. I understand what it does and why it is useful but I’d like to make the most of it without making it unmanageable.

    @eagerbob says

    I use git to version-control the work I do when I work on themes. In that case, my repo is just the (child) theme, not the whole WP install.

    and that’s probably enough for my use case too.

    However, I’d like to underline this point on mirroring rather than cloning.

    I understand that mirroring the public wp repository updates the code on my own repository at intervals. It differs from cloning that is just a static version of the code. Please let me know if I am mistaken here.

    This point allows me to rephrase my question :

    Let’s consider 3 environments :

      Development as a local install
      Production as a live install
      And staging to test that everythings ok before pushing to production

    I was thinking about having the upcoming (beta) version of wordpress locally to anticipate any issue with the code I have in my custom function.php (in a child theme of course)… That doesn’t mean I’d be technically skilled to solve the issues, but at least I would be able to anticipate what to push or not push to the following staging step.

    I am not saying that this is the best method. I do repeat that I have no methods yet, I only have questions, to ask for your best advices.

    My original question was :

    Do you think it’s a good idea to be aware / keep track of every single commit from the wp dev team on wordpress? Or just the commits from our own install is enough?

    It looks like you guys only push the files you authored personnally to keep track of your own modifications… (That’s the point with git you’d reply!)

    What version of wordpress do you use locally? The last stable version? the upcoming beta version?

    Thread Starter tskpbls

    (@tskpbls)

    Hi Ruben,

    So sorry for the late reply, I’ve had a hard time repairing my archlinux os.

    I am not suprised that everything works just fine on a live environment. Still, there’s an issue when i am under staging environment of WPMU, with the standard WP 2020 theme, and only gamipress and ACF fields activated. (so, yes, I have tried with the basics)

    Issue under staging only :

    To be more precise, everything seems to be be working just fine in ACF with a very fresh gamipress install, but as soon I create a rank, or, well any data posted in gamipress, then ACF creates blank fields, or exisiting fields are marked with type : “unknown”.

    Again, all of this is under WPMU staging environment, and ACF looks ok on live environment, so the issue seems to be between the staging environment and gamipress, but not with any other plugin…

    I’ll be online all the time from now on. Sorry again for the late reply.

    Fyi, here’s the last full post from WPMU Staff… I am not sure they tried to create any achievement or rank… With a bare plugin after install, no issue for me either…

    Hello

    Hope you’re having a great day!

    I was able to track down the issue down to a conflict caused by Gamipress in this case. I tested on staging by deactivating almost all plugins and switching the theme to TwentyTwenty to make sure there’s no external interference.

    I left the following plugins active:
    – Advanced Custom Fields
    – BuddyPress
    – Tableau de bord WPMU DEV
    – GamiPress
    – GamiPress – BuddyPress integration

    With those plugins active, I was able to still see the issue in the ACF edit screen, so I started deactivating plugins one by one, first “GamiPress – BuddyPress integration” and then “Gamipress” itself.

    As soon as I deactivated Gamipress, the fields started showing up correctly.

    I also tried to replicate the issue with the same setup on my own test site – both on production and on staging and wasn’t able to do so, it shows up correctly for me in all cases, no fields go missing.

    In this case, especially since Gamipress seems to be causing some issue here and disabling it makes it disappear, we’d suggest it would be best and quickest to contact the support at Gamipress to check in much more detail what is causing the issue. It certainly be much quicker to get this issue solved from their end as they know the plugin in detail and may be able to more quickly tell what caused it.

    As for our system of points, we use a custom solution we developed for ourselves :slight_smile:

    Kind regards,
    Pawel

    Thread Starter tskpbls

    (@tskpbls)

    Hola Ruben,

    I reopen this issue about the ACF fields disappearing under the WPMU staging environment when gamipress is activated.

    Here’s what the guys at WPMU dev replied :

    “As soon as I deactivated Gamipress, the fields started showing up correctly.

    I also tried to replicate the issue with the same setup on my own test site – both on production and on staging and wasn’t able to do so, it shows up correctly for me in all cases, no fields go missing.

    In this case, especially since Gamipress seems to be causing some issue here and disabling it makes it disappear, we’d suggest it would be best and quickest to contact the support at Gamipress to check in much more detail what is causing the issue. It certainly be much quicker to get this issue solved from their end as they know the plugin in detail and may be able to more quickly tell what caused it.”

    Another point : the guys at loco-translate also provided a fix for an early loading issue that prevented the translation of your plugin from their tool.

    The very good comments and rating for gamipress is well deserved I think, it’s easy to set up, and well documented.

    However, from my experience, it looks like it’s quite conflictual with essential plugins :

    Locotranslate : 5 stars, more than 1 million active installs.
    Advanced custom fields : 5 stars, more than 1 million active installs.

    I’d be glad to help with the french translation on translate.www.ads-software.com, but locotranslate, is, for instance, the easiest way to have our own translation strings really matching the philosophy of our gamification… Ranks, for instance can be translated “Grades” or “Rangs” or “Niveaux”…

    Well, Quite a long post, sorry,

    I hope we’ll hear from you, I am sure i am not the only one relying on your plugin and being frustrated by minor issues.

    Que tenga un buen dia / Have a nice day ??

    • This reply was modified 4 years, 5 months ago by tskpbls.
    Thread Starter tskpbls

    (@tskpbls)

    Sorry if I made you feel confused, Tim.

    It’s been quite hard for me to track what was ok and what wasn’t in my install. English is not my native language and it looks like I also have an issue that’s specific to my staging environment and that has a repercussion on both plugins mentioned above (GamiPress and ACF)

    I think we are good to mark this post as resolved.

    Have a great day !

    Thread Starter tskpbls

    (@tskpbls)

    Hi there,

    Another thing to consider that I have not noticed at first sight….
    The issue occurs when I am the WPMU staging environment, not on the live one…

    Hence I’d rather ask the WPMUDEV staff and mark this thread as resolved. Sorry !

    Thread Starter tskpbls

    (@tskpbls)

    Hi Tim,

    Strictly speaking the way Gamipress loads its text domain (too early) is wrong. Well behaved plugins wait for all other plugins to be available before calling any hookable functions. Up to you if you want to mention this. They’re not obliged to fix it.

    I’ll notify them about that, because I can’t see why they wouldn’t be opened for improvements on their plugin, which is a good one already!

    I don’t see any cmb2 strings in the gamipress.pot template file.

    The pot file contains the right gamipress strings, but still, locotranslates loads CMB2.po. Here’s a screenshot uploaded on my google drive to illustrate : (that was before I used your xml, just to illustrate.)

    https://drive.google.com/file/d/1eXvjx8fglUIu3fnGEvYZrqwKK51r3KkJ/view?usp=sharing

    thats’s after using the xml and using the code, making sure loco translate was not activated :

    This is what i’ve got in the advanced tab :
    https://drive.google.com/file/d/11Gfkla7z1jDYJoYbPfHB8O8lTiqGwL25/view?usp=sharing

    Corresponding xml downloaded from the bottom of advanced page : https://drive.google.com/file/d/16ts-kk-uDV_gp4m5x14Zjo5MDRVYfQ5N/view?usp=sharing

    I now have three libraries under the main tab when translating gamipress with loco translate : First is GamiPress, second is CMB2 (still), Third is CT.

    When creating a new language under GamiPress, I can find the right strings, but still cannot save them to a custom folder… Author folder and system folder work ok on save.

    Thanks a lot for your patience on this Tim.

    Thread Starter tskpbls

    (@tskpbls)

    Hi Tim,

    Thanks for the quick answer… After some research, it looks like the issue comes from two plugins so that would be beyond the scope on this forum.

    Just a quick explanation : the strings i’ve got when trying to edit the gamipress.po are the ones from the cmb2 library, shared with Advanced custom fields I guess.

    In other words, gamipress seems to be messing with advanced custom fields and loco translate loads the library fields instead of gamipress.po.

    I’ll go ask their respective support forums and come back to you if needed.

    Thanks a lot,

    Thread Starter tskpbls

    (@tskpbls)

    Hi Nastia!

    Thanks for the reply, I am waiting for the update then!

    Thanks a lot.

    Thread Starter tskpbls

    (@tskpbls)

    Hi Dimitris!

    Thanks a lot for this code! it’s working perfectly on my divi theme inside a code module.

    However I’d like to know if this code provides the number of submissions per month, or the number of submissions all times.

    Even though I used the following example on my first post here : “there are XXX nex members this month”, i’d rather use the following : “we are currently 12345 members.”

    So, switching back to zero each month is not a desired behaviour, will that happen with this shortcode?

    Thanks!

Viewing 12 replies - 1 through 12 (of 12 total)