Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernized plugin code #131

Closed
wants to merge 127 commits into from
Closed

Modernized plugin code #131

wants to merge 127 commits into from

Conversation

onyijne
Copy link

@onyijne onyijne commented Oct 12, 2022

Fixes

Fixes #127 by @TimidRobot

Description

  • It has restructured the PHP code to PSR-1 standard.
  • Laid the foundation for plugin to be installed via composer
  • Paid attention to WordPress plugin standard
  • Restructured code to future release proof
  • Containerized plugin
  • Update all JavaScript functions to arrow functions
  • Changed all string concatenations to es6 literals

Technical details

For development purposes a docker-compose.dev.yml file was created with Mariadb and PhpMyadmin services.
I used 8701 as my outside port, you can use anyone that’s open and free on your host machine. And also set up the ip address where applicable.
On IP, the tot_mariadb_1 container IP address can be gotten by accessing the container, install iproute2 (done once) like this:
docker exec -it tot_mariadb_1 bash then install iproute2 apt-get update && apt-get install iproute2 -y after which you can use ip addr | grep global to get its IP.

After getting the files, for example from my repo
git clone github.com/onyijne/termination-of-transfer.git
Then cd to it and run
docker-compose -f docker-compose.dev.yml up —build
This should start the wp, mariadb and phpmyadmin services.
If you already have a mysql container running, you can just do
docker run --name wp-cont -e WORDPRESS_DB_HOST=host:port -e WORDPRESS_DB_USER=user -e WORDPRESS_DB_PASSWORD=pass -p 8701:80 -d wp-image
A working example

Tests

To run Result test on your machine type chmod +x test/result-pdf.sh && test/result-pdf.sh 8701 where 8701 is the port number of your host machine.

Screenshots

alt  #screenshot

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the default branch of the repository (main or master).
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no
    visible errors.

Developer Certificate of Origin

For the purposes of this DCO, "license" is equivalent to "license or public domain dedication," and "open source license" is equivalent to "open content license or public domain dedication."

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

…ce to CreativeCommons_TOT with src folder as the source folder to the plugin codebase susing autoload psr-4.
@onyijne
Copy link
Author

onyijne commented Oct 25, 2022

Hi @possumbilities please I think you wanted to assign me elsewhere. The reviewed PR is #132 for #127

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Convert repository / codebase to a WordPress plugin that can be installed via composer
1 participant